GCSE · Computer Science · AQA · Spec 8525

Database tables

A school office needs any pupil's details in seconds, and a computer does it with a table. Let's pull one apart and see the rules it plays by.

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?

This school's database has a Pupils table and a Teachers table, and exactly one field turns up in both. For each field, tick every table that stores 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 of those steps 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 each 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 keeps its data in tables. Each table is 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 goJay says: 'To store every pupil's form group, just add a row.' What should the school add, and what would Jay's row actually create?

    A new column (a new field). Jay's row would create a brand-new pupil.

    A row is one whole record, so Jay's row would add another pupil. A new kind of detail for everyone is a new field.

  • Every field has a field name, written at the top of its column, such as Surname.
  • Every field also has a data type, such as integer, text or date. All records use that type for that field.
  • Every record has the same fields, with the same names and data types. No record gets extras of its own.
  • Have a goDev reckons it's fine to type 'ask me later' into one pupil's DateOfBirth, a date field. Is he right?

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

    The data type belongs to the field, so every record uses it. One record can't pick its own.

  • A table normally has a primary key: a field with a different value in every record, so it picks out exactly one.
  • Pick a key that can never repeat. A key that repeats stops identifying one record.
  • Have a goA shop gives every customer a customer number. Why could that be a better primary key than the customer's full name?

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

    A primary key must be different in every record. A number can be, but names can repeat.

  • One database can hold several tables. In a relational database they are linked through fields they have in common.

The big picture

A 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 picks out exactly one. One database can hold several tables, linked through fields they have in common.

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 fields 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 one record can have fields of its own, or its own data type for a field. It can't. A table is a grid with rules: every record has the same fields, with the same names and data types.

🧠

Memory hook

A column is a pillar: it holds up one kind of detail all the way down. A row is a line of people: one whole pupil, standing side by side. 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

(10)
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, stored 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.
Why is a field like Surname a poor primary key?
Its values can repeat across records, so it no longer identifies exactly one.
How are the tables in one relational database linked?
Through fields they have in common.
A table needs to store a new kind of detail for everything in it. What gets added?
A new field, which means a new column that every record then has.

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 26 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.