Skip to content
Educator
GCSE Computer Science

Relational Databases and SQL

98 questions11 subtopicsAQAOCREdexcelEduqas
Practise all 98 questions free →

What's covered

SQL — SELECT, FROM, WHERE14
Queries Across Two Tables10
Avoiding Data Inconsistency and Redundancy9
SQL — DELETE FROM9
SQL — INSERT INTO9
Table, Record, Field, Data Type9
Concept of a Relational Database8
Primary Keys and Foreign Keys8
SQL — UPDATE8
Concept of a Database7
SQL — ORDER BY (ASC / DESC)7

Key facts

1

Avoiding Data Inconsistency and Redundancy

The best way to avoid storing a customer's address twice is to store the address once in a Customers table and link to it from Orders via a foreign key.

2

Concept of a Database

A database is an organised collection of data.

3

Concept of a Relational Database

A flat-file database stores all data in a single table (or file) without explicit links to other tables.

4

Primary Keys and Foreign Keys

A composite primary key uses two or more columns together for uniqueness — useful when no single column is unique on its own.

5

Queries Across Two Tables

In AQA-style GCSE SQL, two tables are joined using a WHERE clause that matches the key fields: ... FROM A, B WHERE A.id = B.a_id.

6

SQL — DELETE FROM

DELETE FROM removes records (rows) from a database table.

7

SQL — INSERT INTO

INSERT INTO Books DEFAULT VALUES inserts a row using each column's declared default value (where defined).

8

SQL — ORDER BY (ASC / DESC)

ASC stands for ascending order — smallest to largest, or A→Z for text.

9

SQL — SELECT, FROM, WHERE

The core SQL data-manipulation commands are: SELECT (retrieve data from a table), INSERT INTO (add a new record), UPDATE (change data in existing records), and DELETE FROM (remove records).

10

SQL — UPDATE

The SET clause specifies the new field values to assign.

Sample questions

A taste of the 98 questions in this topic, answers marked. Sign up to practise the full set with spaced repetition.

1Avoiding Data Inconsistency and Redundancy

What is data redundancy?

  • •Data stored across multiple tables using foreign keys
  • •Data that has been encrypted and backed up
  • •Missing values in a database record
  • ✓Same data stored more than once
2Concept of a Database

Why use a database instead of separate files?

  • •Always smaller in size than text files
  • ✓Better organised and easier to query
  • •Removes the need for storage devices
  • •Runs much faster than the CPU only
3Concept of a Relational Database

What is the main advantage of a relational database?

  • ✓Reduces data duplication across tables
  • •Removes the need for primary keys
  • •Runs queries entirely without indexes
  • •Stores every record in just one table
4Primary Keys and Foreign Keys

Why use a foreign key?

  • •To compress data in the database file
  • ✓To link records across two tables
  • •To remove the need for primary keys
  • •To store random keys in each record
5Queries Across Two Tables

What links two tables in a relational query?

  • •A common SQL alias
  • ✓A matching foreign key
  • •A shared table name
  • •An identical column data type
6SQL — DELETE FROM

Which SQL removes Sam from Students?

  • ✓DELETE FROM Students WHERE name = 'Sam'
  • •DELETE Sam FROM Students table now
  • •DROP Students WHERE name = 'Sam' only
  • •REMOVE FROM Students WHERE name = 'Sam'

Try it for four weeks. Free.

One school. Unlimited classes. No card limit. No teacher limit. If your students aren't practising daily by the end of the trial, you owe us nothing.

More GCSE Computer Science topics

📖 All GCSE Computer Science key terms & vocabulary →