Skip to content
Your progress

Checking your sign-in…

Who's learning?

Each profile keeps its own read lessons, badges, streak, and practice scores on this device.

Lesson 8 of 11

What a database adds

Show on a big screen

7 min

Text size

This term taught one way to question a table: walk the rows. A row is kept when it meets the condition. It is passed over when it does not.

Five rows, no marks yet.
Step 1 of 4
  1. Five rows, no marks yet.
  2. Each row is kept or passed, in turn.
  3. The count grows only when a row is kept.
  4. The answer comes back after every row.

The rule

One query means the same as a walk. Read the condition, take each row, keep it or pass it. Hand back what you kept. A database program can give the same answer. A report with empty groups must list them first.

A database is an organised set of tables. A database program keeps them and answers questions, fast.

Your walk looks at twelve rows. A real table can hold thousands. A database program is made for tables that big. Its answer must match your walk's answer.

Databases have their own written language for asking. Here you wrote each question as a program yourself.

Walk the query below, one record at a time.

Loading lab…

This walk gives the answer a database program must match.

Try the lab to finish this lesson.