SQL has five main purposes
Data Definition Language DDL
- Use
CREATE TABLE to define the structure of a table (columns, data types, constraints).
- Use
ALTER TABLE to modify the structure of an existing table (e.g. add a column). ⚠️
Data Manipulation Language DML
- Use
INSERT INTO to add data to the table, either row by row or in bulk.
- Use
UPDATE to modify existing rows (based on a condition). ⚠️
- Use
DELETE to remove rows based on a condition. ⚠️
Data Query Language DQL
- Use
SELECT to retrieve data from the database.
Data Control Language DCL + Transaction Control Language TCL
⚠️ Covered in the take-home exercise