

Lesson 01 · 9 min
Tables and SELECT
A table is rows and columns. SELECT picks which columns to show.
9 minLesson 1 of 10Practice includedAsk AI on any point
A relational database stores data in tables. Every column has a type (integer, text, timestamptz), every row is one record. The primary key id uniquely identifies a row. A SELECT query changes nothing; it only reads.
NOT NULLmakes a field required,UNIQUEforbids repeats,DEFAULTsets a default value.- Keywords are written in capitals by habit; the database doesn't care.
ASrenames a column in the result:SELECT name AS title.
Check
Lock it in before you move on
1. What does PRIMARY KEY do?
2. Why is
SELECT *bad in app code?3. A column is
NOT NULL. Can you insert a row without it?