Computer Science Essentials, Unit 5, Lesson 1 of 4

Relational databases and records

GCSE Computer Science, Databases and SQL, 25 minutes

Sign in

Tables, records and fields, data types, primary and foreign keys, why linked tables beat one big table, and how a program holds records in a 2D array.

What you will learn

  • Name the parts of a database table
  • Choose a data type for a field
  • Pick out primary and foreign keys
  • Explain redundancy and inconsistency
  • Read records held in a 2D array

Tables, records and fields

A database is an organised, permanent store of data that can be searched, sorted and updated.

The data sits in tables.

Table: Film

FilmIDTitleGenreYear
1Silver RiverDrama2011
2Paper CometFamily2019
3Quiet EngineDrama2004
  • A record is one row: everything stored about one film. This table has 3 records.
  • A field is one column: one piece of data stored for every record. This table has 4 fields.
  • Every field has a data type: integer, real, Boolean, character, string or date. Year is an integer; Title is a string.

The rest of this lesson and its 9 practice questions are locked.

In this lesson

  1. Tables, records and fields
  2. Keys and linked tables
  3. Records in a program
  4. Try it: Find the keys

9 practice questions, marked as you go; about 25 minutes in all.

Key terms

Database, Tables, Record, Field, Primary key, Relational database, Foreign key, Once, Data redundancy, Data inconsistency

In this unit: Databases and SQL

Tables, records and fields, primary and foreign keys, why linked tables beat one big table, SQL queries over one or two tables, changing data with INSERT, UPDATE and DELETE, and reading and writing CSV files.

All of Databases and SQL