Module 55: SQL Fundamentals

Lesson 2 of 5 · 15–25 minutes

Creating and changing tables

🏠The everyday picture

Printing a new register with its column headings, adding a column later when a new rule needs it, and, rarely, retiring an old register altogether.

📘What it really is

CREATE TABLE courses (
  id integer PRIMARY KEY,
  title text NOT NULL UNIQUE,
  fee_paise integer NOT NULL CHECK (fee_paise >= 0),
  starts_on text
) STRICT;

🖱️Try it

Create the courses table above. Add a level column. Then create a practice table scratch, insert one row, and drop it. Notice how quickly the data is gone.

✅Quick check

What does DROP TABLE do to the data inside?

Show the answer

Deletes it permanently, along with the table.

Why are schema changes made through migration files in real projects?

Show the answer

So every copy of the database changes in the same, recorded, repeatable way.

← PreviousWhat SQL is
ProLearners Assist