Camp 1 · Step 2 of 13
Tables, rows, and columns
The three-word vocabulary of relational databases — and the sample data you'll query all trail long.
Relational databases organize everything into tables — and once you can read one, you can read them all.
The anatomy
Meet trails, one of the two sample tables loaded into every playground
on this course:
trails
+----+------------+------------+---------+
| id | name | difficulty | lessons |
+----+------------+------------+---------+
| 1 | python | beginner | 23 |
| 2 | javascript | beginner | 18 |
| 3 | html | beginner | 14 |
| 4 | rust | beginner | 12 |
| 5 | sql | beginner | 13 |
+----+------------+------------+---------+- Each column holds one kind of fact (
name,lessons) with one data type - Each row is one complete record — one trail
- The id column gives every row a unique tag — its primary key
Why an id column?
Names change, duplicates happen ("two hikers named Ada"), but the primary
key stays unique and stable forever. Other tables refer to rows by this
key — the hikers table you'll meet soon points at trails via a
trail_id column. Those links are what make databases relational.
Try the real thing
The playground below is live — run it to see the whole table:
SELECT * FROM trails means "show every column of every row of trails" —
the database equivalent of opening the file. Next lesson we'll get precise.
In the trails table, what is one entire horizontal line (id, name, difficulty, lessons)?
What makes a primary key column special?
What's next
Your first real queries: SELECT, choosing columns, and picking exactly the rows you want.