thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

Data & Analytics · Foundational

Data Definition Language (DDL)

The SQL commands that define and change database structure: CREATE, ALTER, DROP, TRUNCATE and RENAME.

Definition

DDL operates on schema objects such as tables, views, indexes and schemas rather than on the rows inside them. In Oracle, MySQL and Snowflake, DDL statements commit implicitly. SQL Server and PostgreSQL allow DDL inside explicit transactions.

Example

CREATE TABLE, ALTER TABLE ADD COLUMN, DROP VIEW

Exam tip

TRUNCATE is classified as DDL in most databases even though it removes data.

Related terms