Loading subject…
CREATE TABLE Customer (CustomerID INT PRIMARY KEY, CustomerEmail VARCHAR(255));ALTER TABLE Customer ADD COLUMN CustomerAddress VARCHAR(255);DROP TABLE Customer;TRUNCATE TABLE Customer;RENAME TABLE Customer TO Client;TRUNCATE TABLE Customer the table still exists and you can insert new rows into it straight away.DROP TABLE Customer the table definition is gone, so any query naming it now fails.| Aspect | DDL | DML |
|---|---|---|
| What it acts on | The structure: tables, columns, constraints | The data: the rows inside those tables |
| Commands | CREATE, ALTER, DROP, TRUNCATE, RENAME | SELECT, INSERT, UPDATE, DELETE |
| Committed automatically | Yes, the change is permanent at once | No, it can be committed or rolled back |
| Typical user | Database designer setting the schema up | Application or end user working day to day |
| Frequency of use | Rare, mostly when the design changes | Constant, every time the application runs |