Data Definition Language (DDL)

Rumman Ansari   Software Engineer   2023-05-03   6422 Share
☰ Table of Contents

Table of Content:


Data definition language (DDL) is used for defining the database schema. The DBMS comprises DDL compiler that identifies and stores the schema description in the DBMS catalog. A separate language, namely storage definition language (SDL) is used to define the internal schema and a third language, namely, view definition language (VDL) is used to define the external schema. DDL also accepts input in the form of instructions (statements) and generates the description of schema as output. The output is placed in the data dictionary. The DDL statements are also used to specify the integrity rules.

Some tasks that come under DDL

Here are some tasks that come under DDL:

  • Create: It is used to create objects in the database.
  • Alter: It is used to alter the structure of the database.
  • Drop: It is used to delete objects from the database.
  • Truncate: It is used to remove all records from a table.
  • Rename: It is used to rename an object.
  • Comment: It is used to comment on the data dictionary.

These commands are used to update the database schema that's why they come under Data definition language.

Points to remember:

  • DDL stands for Data Definition Language. It is used to define database structure or pattern.
  • It is used to create schema, tables, indexes, constraints, etc. in the database.
  • Using the DDL statements, you can create the skeleton of the database.
  • Data definition language is used to store the information of metadata like the number of tables and schemas, their names, indexes, columns in each table, constraints, etc.