DDL: Data Definition Language

In data repositories that use SQL to access and interface with the data, the definition of data or the data definition language (DDL) is a syntax that allows creating and modifying database objects such as tables, indexes, and users. DDL statements are similar to a computer programming language for defining data structures, especially database schemas. Common examples of DDL statements include CREATE, ALTER, and DROP.

Today’s databases incorporate DDL in any formal language that describes data, although it is considered a subset of SQL. SQL allows standard English imperative verbs, such as sentences, to implement modifications to the database. Because of this, DDL does not appear as a different language in an SQL database but defines changes to the database schema. The DDL commands are intended to manipulate and modify objects, such as users, databases, schemas, tables, views, columns, functions, and create stored procedures.

DDL aims to establish and modify the structure of objects stored in a database. These definitions and modifications control descriptions of the database schema. They are different from Data Manipulation Language (DML) commands used for data modification purposes because DDL commands are used to alter the structure of the database. Examples of this are creating new tables or objects along with all their attributes such as data type, table name, etc.

The relational model is, in principle, independent of the platform or infrastructure used. This independence allows DDL syntax in different database and infrastructure providers such as Oracle, DB2, MySQL, Microsoft SQL Server to be very similar. The parameters of these expressions are aimed at physical interfaces, such as location, space, buffers, cache, etc.

You can define scripts with DDL commands so that objects in a database:

  • Keep a snapshot of the database structure.
  • Set up a test system where the database acts as the production system.
  • Generate templates for new objects according to the situation in the existing ones. An example would be generating a DDL for the User table, then editing the DDL to create the User_New table with the same schema.

Data users can use DDL statements to build on a database except for its content when generating a DDL script. DDL commands can be used to completely recreate the database or recreate only certain aspects of it, such as its current statistics. You can also limit the generated statements so that only one segment of the database is recreated.

 

Satori logo2 white