GCSE · Computer Science · AQA · Spec 8525

Database tables

Picture a school office that has to find any pupil's details in seconds. A computer does it with a table. Let's take one apart and see the rules it follows.

Computer Science · Databases

Take a table apart
PupilsPupilIDSurnameForenameDateOfBirth1001KhanZara12/03/20101002KhanOmar05/09/20091003EvansLily30/01/20101004OkaforSam21/06/2010integertexttextdate

Showing 2 layers: The Pupils table, Data types

Layers

Explore

tap a part of the table

Peeled on: the data type of each field sits above its field name.

Tap a part of the table to see what it is. Peel the data types on and off too.

Computer Science · Databases

Which table does it belong in?

A school database has a Pupils table and a Teachers table. One field turns up in both. For each field, tick every table that should store it.

  • A Pupils table
  • B Teachers table
  1. Pupil ID
  2. Pupil name
  3. Date of birth
  4. Teacher ID
  5. Teacher's subject
  6. Teacher's room

Exam line: Each table is about one type of thing. A field that appears in both tables is what links them.

Computer Science · Databases

Find the faulty set-up line

A student sets up the Pupils table in four steps, then tests it. One step is wrong. Which one?

A student's plan — which line goes wrong?

Exam line: A primary key must have a different value in every record.

Computer Science · Databases

Which idea is closest to yours?

Four pupils are describing the Pupils table from the top of this lesson.

Whose description is closest to what you think right now?
How sure are you?

Exam line: A row is a record. A column is a field. Every record has the same fields with the same names and data types.

WHAT YOU'VE LEARNED

A quick recap of today's lesson.

One type of thing per table, one record per row, one field per column.

What you need to know

  • A database stores its data in tables. Each table holds data about one type of thing, such as pupils. That type of thing is the entity.
  • Each row is one record: everything the table stores about one pupil.
  • Each column is one field: one kind of detail, like surname, that every record has.
  • Have a goA school wants to record every pupil's form group in the Pupils table. Do they add a new row or a new column?

    A new column, which is a new field.

    A row is a whole pupil, so a row would add another pupil; a new kind of detail for everyone is a new field.

  • Each field has a field name, written at the top of its column, such as Surname.
  • Each field also has a data type, such as integer, text or date. Every record uses that type for that field.
  • Have a goDev is sure it is fine to type 'ask me later' into one pupil's DateOfBirth, which is a date field. Is he right?

    No. That record would hold text in a date field.

    Data type belongs to the field, so every record has to use it; one record cannot choose its own.

  • Every record has the same fields, with the same names and data types. No record gets fields of its own.
  • The primary key is a field whose value is different in every record, so it picks out exactly one record.
  • Choose a primary key that can never repeat. A key that repeats stops identifying one record.
  • Have a goA shop gives every customer a customer number. Why might that make a better primary key than the customer's full name?

    A number can be different for every customer, but two customers could share a name.

    A primary key has to be different in every record so that it picks out exactly one record.

  • One database can hold several tables. They can be linked through a field they have in common.

The big picture

A database table holds data about one type of thing. Each row is a record and each column is a field. Every record has the same fields, with the same names and data types. The primary key is different in every record, so it identifies exactly one. A database can hold several tables, linked through common fields.

Key points

1Each table is about one type of thing, the entity. Each row is one record and each column is one field.
2Every field has a field name and a data type, and every record has the same fields.
3The primary key has a different value in every record, so it identifies exactly one record.
4Several tables can sit in one database, linked through a field they have in common.

Worked example

Problem

A library wants a Books table. Decide what the table is about, its fields, their data types and its primary key.

⚠ Watch out

Thinking each record can have fields of its own, or its own data type for a field. They can't. A table is a grid with rules, so every record has the same fields with the same names and data types.

🧠

Memory hook

A column is like a pillar: it holds up one kind of detail all the way down. A row runs across like a line of people: one whole pupil. Pillar = field. Line = record.

✓

Check yourself

A Teachers table has the fields TeacherID, Name, Subject and Room. Two teachers can both teach Maths. Which fields could repeat across records, and which field would make the best primary key?

Flashcards

(9)
What does one table in a database hold data about?
One type of thing, called the entity, such as pupils.
In a table, what is a record?
A row: everything the table stores about one item, such as one pupil.
In a table, what is a field?
A column: one kind of detail, such as Surname, held for every record.
What is a field name?
The label at the top of a column that says which kind of detail it holds.
What is a data type?
The kind of data a field holds, such as integer, text or date. Every record uses it for that field.
Can one record have a field the other records don't?
No. Every record has the same fields, with the same names and data types.
What is a primary key?
A field whose value is different in every record, so it picks out exactly one record.
What makes a field a poor primary key?
Its value can repeat across records, so it no longer identifies exactly one.
How can the tables in one database be linked?
Through a field they have in common.

Tap any card to flip it, or use Study as deck to go through them one at a time. In the full lesson these run as a spaced-repetition deck — you rate each card Hard, Good or Easy and the tricky ones keep coming back until they stick.

Learning with Lightbulb is opening soon

You can use this lesson now. Join the waitlist and we'll let you know when the full Lightbulb experience is ready.

Keep me posted

More AQA GCSE Computer Science topics

See the full AQA Computer Science curriculum →

How this lesson was checked. This AQA GCSE Computer Science (specification 8525)lesson was published through Lightbulb Learning's human-designed editorial process — the educational standards, accuracy rules and publication checks it must pass were authored and approved by Philip Halpin. It passed subject-specific assessment, automated educational checks and technical publication verification before going live (publication checks completed 9 October 2026). Published pages are monitored, human spot-checking is ongoing across the lesson library, and anything found wrong is corrected or withdrawn. How our lessons are made and checked. Spotted a mistake? Email hello@lightbulblearning.co and we'll review it.