<aside> 🏗️ DDL commands define and manage database structure: CREATE, ALTER, DROP.

</aside>


1. CREATE — Create a Table

Use CREATE TABLE to define a new table with columns and constraints.

CREATE TABLE persons (
    id INT NOT NULL,
    person_name VARCHAR(50) NOT NULL,
    birth_date DATE,
    phone VARCHAR(15) NOT NULL,
    CONSTRAINT pk_persons PRIMARY KEY (id)
)

2. ALTER — Modify Table Structure

Use ALTER TABLE to add or remove columns from an existing table.

-- Add a new column
ALTER TABLE persons
ADD email VARCHAR(50) NOT NULL
-- Remove a column
ALTER TABLE persons
DROP COLUMN phone

3. DROP — Delete a Table

Use DROP TABLE to permanently delete a table and all its data.

-- Delete the table
DROP TABLE persons

<aside> ⚠️ DROP is irreversible! Always back up before dropping tables.

</aside>


Common Data Types