Data Definition Language, or DDL, is the part of SQL used to define and manage the structure of a database, including tables, indexes, and views. The three commands at the heart of DDL are CREATE, ALTER, and DROP. They let a developer build new structures, modify existing ones, and remove structures that are no longer needed.
The CREATE TABLE statement defines a brand-new table by specifying its columns, their data types, and any constraints. For example, CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(50)); creates a table with two columns and a primary key on the id. Once a table exists, its structure can evolve using ALTER TABLE, which adds or drops columns and constraints. An example is ALTER TABLE users ADD email VARCHAR(100);, which appends a new email column to the users table.
When a table is no longer needed, the DROP TABLE command permanently removes it along with all of its data. The command DROP TABLE temp_table; is final, so it should be used with care. Together, CREATE, ALTER, and DROP give administrators full control over the database schema, from initial creation through ongoing maintenance.