Search code examples
sqlddlalterdml

Why ALTER command is referred as DDL and not DML?


I was going through the different commands in SQL and I came across ALTER command which is referred as DDL (Data Definition Language). We can alter the column and values in it, so we can manipulate the data with this command so why does alter command is not referred as DML (Data Manipulation Language).

I have googled and I cannot come across some good explanation, so please help me with this.


Solution

  • ALTER command is used to alter the structure of the database. And this is what DDL does, i.e. DDL statements are used to define the database structure or schema.

    Whereas DML statement is used to manage data within schema objects.