After this lesson, you will be able to: Explain what a relational database is and how tables, rows, columns, primary keys, and foreign keys work together.
SQL is the most-used data language on earth. Every backend dev needs it, not just for data work. PostgreSQL is what LastWrite (and most modern startups) use, and what this subtrack uses for all hands-on exercises.
This is a free introductory lesson. No purchase required.
SQL has been the dominant query language since 1980 and still is. Every backend engineer interacts with it: REST APIs hit relational DBs, ETL pipelines pull from warehouses, analysts run reports. Knowing SQL well separates juniors who 'use the ORM' from engineers who debug slow queries.
Table = a spreadsheet. Rows = records. Columns = fields. Each column has a type (integer, text, date, boolean, etc.), enforced. Each table has a PRIMARY KEY, a column (or combo) that uniquely identifies each row. Tables relate via FOREIGN KEYS, a column whose value matches another table's primary key.
Users + their posts.
CREATE TABLE users (id SERIAL PRIMARY KEY, -- auto-incrementing intemail TEXT NOT NULL UNIQUE,name TEXT NOT NULL,created_at TIMESTAMPTZ DEFAULT NOW());CREATE TABLE posts (id SERIAL PRIMARY KEY,user_id INTEGER NOT NULL REFERENCES users(id) ON DELETE CASCADE,title TEXT NOT NULL,body TEXT NOT NULL,published BOOLEAN DEFAULT FALSE,created_at TIMESTAMPTZ DEFAULT NOW());INSERT INTO posts (user_id, title, body, published)VALUES (1, 'Hello SQL', 'My first post.', TRUE);
Using SQLite or MySQL syntax with Postgres (or vice versa, they differ subtly). Treating SQL as 'just talk to ORM', debugging slow queries needs real SQL fluency. Missing NOT NULL constraints on required columns (NULL bugs are forever). Picking VARCHAR over TEXT in Postgres (no performance difference; TEXT is cleaner).