CREATE Table
CREATE TABLE students (roll INT PRIMARY KEY, name VARCHAR(50) NOT NULL, marks INT); draws the register: column names, types, and rules. PRIMARY KEY means each roll is unique and not NULL. NOT NULL on name means you cannot insert a student without a name.
Order: database selected (USE), then CREATE TABLE, then INSERT rows, then SELECT. Empty table is normal after CREATE — it is not an error.
CREATE TABLE marks (id INT PRIMARY KEY AUTO_INCREMENT, roll INT, subject VARCHAR(30), score INT, FOREIGN KEY (roll) REFERENCES students(roll)); now two tables are related.
Trap: no PRIMARY KEY. Trap: VARCHAR with no length in old habits. Trap: reserved words as column names (date, order) — use backticks or a better name (order_date).
On the example next to this theory — CREATE TABLE defines columns and constraints; then INSERT sample rows.
CREATE TABLE students ┌──────┬────────┬───────┐ │ roll │ name │ marks │ ├──────┼────────┼───────┤ │ (empty until INSERT) │ └──────┴────────┴───────┘
Show students(roll PK, name, marks). Say empty table after CREATE is OK.