The Life Starter
0 of 6 complete0%
Course Library · Lesson 1 of 6
Digital · Guided lesson

Build two tiny tables

About 27 minutes · 7 reading + 20 practice and checks
Time includes reading, practice, and questions. Extra videos or further study are optional.
See this course’s project requirements

Answer whether one assigned workshop session can accommodate six additional bookings using your accumulated query collection.

Keep your working files in your own notebook or software. Save a private description, checklist, and work link in My Proof.

What to include

  • Include the complete original two-table fixture and dictionary.
  • Show filtering, ordering and grouped summaries with expected results.
  • Demonstrate both session-preserving and venue-preserving joins.
  • Detect an invalid test record and record missing-data limits.
  • Deliver the decision query with reproducible output and interpretation.

Review and revise

Use these criteria to check your work and choose what to improve.

  • Question fit: row and group meanings match the decision.
  • Query correctness: results follow from explicit SQL or accurate traces.
  • Quality: totals reconcile and missing matches are explained.
  • Reproducibility: fixture, queries and limits travel with the answer.
Open the full course project
Want more background?
Before you begin

The idea in everyday life

A database becomes easier to question when each row means one clearly defined thing. Here the fictional Civic Workshop schedules group sessions without storing any participant names. You will use session records and site records. The full fixture below supports all six lessons; you may execute it locally or work directly from its rows on paper.

The idea

A table stores one kind of thing; a key distinguishes each row.

Try it

One step at a time.

Use the sample or information you have permission to use. Keep your work as you go. You can pause between steps.

  1. 1

    Define sessions as one row per workshop session, not one row per person. Define sites as one row per venue. Write the meaning and unit of each column before doing arithmetic.

  2. 2

    Copy the complete practice data and SQL setup commands into a fresh, empty SQLite database if one is available. Otherwise draw the two tables from the INSERT values. No remote database or account is required.

  3. 3

    Mark id as the unique session key and code as the unique site key. Distinguish an identifier from a quantity: site code A is a label, while seats=10 is a count.

  4. 4

    Interpret NULL for session 4 as an unassigned site, not a venue named NULL. Keep this row visible because later questions may depend on missing information.

  5. 5

    Count four session rows and three site rows. Save the fixture and a session dictionary explaining id, site, seats and booked, plus their row meaning.

Example

See how it works.

Fictional fixture, to run once in a fresh SQLite database:

sql
CREATE TABLE sites(code TEXT PRIMARY KEY, name TEXT);
INSERT INTO sites VALUES ('A','North'),('B','South'),('C','West');
CREATE TABLE sessions(id INTEGER PRIMARY KEY, site TEXT, seats INTEGER, booked INTEGER);
INSERT INTO sessions VALUES (1,'A',10,6),(2,'A',8,8),(3,'B',12,3),(4,NULL,6,0);
SELECT * FROM sessions ORDER BY id;

Rows 1 and 2 share site A but remain different sessions because their IDs differ. Site C exists without a session. Row 4 has six seats and no bookings, but its venue is unknown. Those two kinds of absence will produce different join results. No individual attendee information is collected.

Check your work

Did you cover these?

  • Four sessions and three sites are present.
  • Session IDs are unique.
  • NULL is documented as unassigned.
Your work

What to finish

The two-table fixture and column dictionary.

Common mistake

Watch for this

Using a site code as the unique session identifier when sites host multiple sessions.

How can I tell I understand it?

Explain each row and distinguish NULL from a real site code.

Try 3 questions

Quick knowledge check

Answer all 3 questions. Get at least 2 right and the lesson completes automatically.

Not yet passed

You’ll get an explanation for each answer. Signed in? Your results save to your account.

1A venue runs sessions 21 and 22. Which field can identify each session uniquely?
2A row has booked=NULL. What can you safely conclude?
3Which fixture is appropriate for this course?
0 of 3 answeredApply the lesson to a short question, then review the explanation.
1
Finish this lesson

Pass the check. We’ll save the progress.

Answer all 3 questions above and get at least 2 right. You can review the explanations and try again.

Go to the knowledge check
Tools, templates, and lesson sources

Tools and templates

Tools open in a new tab so you can keep your place here.

Sources and further reading

Explore the references behind this lesson.

Harvard CS50 — Introduction to Databases with SQL
Source & access notes · checked 2026-09-10

Opened university OpenCourseWare overview; verified querying, relationships, design and optimization topics. Used as optional further study, with original fixtures here.

Access: Free OpenCourseWare reading and videos. External grading or progress services may require accounts; optional verified certificates have separate enrollment and may be paid. This course awards no Harvard credit or affiliation.

Reuse: Linked for reference. Examples, activities and assessments here are original; free access alone does not grant permission to reuse source text or branding.

SQLite — CREATE TABLE reference
Source & access notes · checked 2026-09-10

Opened official table-definition documentation including keys and constraints. Tables use explicit primary keys and original nonpersonal test data.

Access: Free public reading; no account or certificate is required for this Life Starter course.

Reuse: Linked for reference. Examples, activities and assessments here are original; free access alone does not grant permission to reuse source text or branding.

Report a problem with this lesson

Tell us what went wrong. Please leave out personal information and private project contents.

No sign-in needed.