SQfieldnotes.
Read-only practice
YOUR FIRST QUERY STARTS HERE

Make data
make sense.

Learn SQL by asking real questions of a small school library. Try a query, see what comes back, and follow the clues.

Explore a first lesson ↓
✳
✳
membersmember_id  name1     Avery2     Sam
loansmember_id  book_id1     1012     104
booksbook_id  title101   The Wild Robot104   The Hobbit
THREE TABLES, ONE STORY ↗
01 / LEARN BY DOING

Start with a question.

A small library dataset · 3 short lessons
SQL EDITOR / school_library
POSTGRESQL · READ ONLY
ASKFind the newest books in the library.
⌘ ↵   to run
RESULTS / Run a query to see results
✳Your results will show up here.Start with the example, then make it your own.
02 / FOLLOW THE DATA

Know what you’re querying.

Three related tables. Find the keys, follow a relationship, and see how the pieces fit.

Connecting to the teaching database…
⌑ Keys ending in _id connect records across tables.
✳
A GOOD PLACE TO BEGIN

Start with SELECT and FROM. Add one question at a time. The database is read-only, so you can explore freely.

Back to the editor ↑