What are SQL statements used for?
Interacting with tables, columns, and rows in relational databases
What are the two main categories of SQL statements?
Data Definition Language (DDL) and Data Manipulation Language (DML)
What does DDL stand for?
Data Definition Language
What does DML stand for?
Data Manipulation Language
What are DDL statements used for?
Defining, changing, or deleting database objects like tables
Name four common DDL statements
CREATE, ALTER, TRUNCATE, DROP
What does CREATE do in SQL?
Creates tables and defines columns
What does ALTER do in SQL?
Modifies table structure (add/drop columns, change data types)
What does TRUNCATE do in SQL?
Deletes all data in a table but keeps the table structure
What does DROP do in SQL?
Deletes a table completely
What are DML statements used for?
Reading and modifying data in tables
What does CRUD stand for?
Create, Read, Update, Delete
Name four common DML statements
INSERT, SELECT, UPDATE, DELETE
What does INSERT do?
Adds new rows to a table
What does SELECT do?
Retrieves data from a table
What does UPDATE do?
Modifies existing rows in a table
What does DELETE do?
Removes rows from a table
Which category does CREATE belong to?
DDL
Which category does INSERT belong to?
DML
Which category does DROP belong to?
DDL
Which category does SELECT belong to?
DML
What is the key difference between DDL and DML?
DDL changes structure; DML changes data
What are key considerations before creating a table?
Choose schema, define table name, define column names and data types, decide on NULLs and duplicates, reference ERD
Why are schemas important when creating tables?
They logically organize database objects