Educator
GCSE Computer Science

Relational Databases and SQL

121 questions11 subtopicsAQAEdexcelEduqasOCR
Practise all 121 questions free →

What's covered

SQL — SELECT, FROM, WHERE14
Queries Across Two Tables13
Primary Keys and Foreign Keys12
Table, Record, Field, Data Type12
Avoiding Data Inconsistency and Redundancy10
Concept of a Database10
Concept of a Relational Database10
SQL — DELETE FROM10
SQL — INSERT INTO10
SQL — ORDER BY (ASC / DESC)10
SQL — UPDATE10

Key facts

1

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

A database is an organised collection of data.

3

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

4

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

5

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

DELETE FROM does NOT remove the table itself from the database.

7

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

8

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

9

The FROM keyword specifies the table (or tables) the query retrieves data from.

10

The SET clause specifies the new field values to assign.

Sample questions

A taste of the 121 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

How are tables in a relational database linked?

  • Through random row order in each table
  • Through shared keys between tables
  • Through the file size of each table
  • Through the names of the columns alone
4Primary Keys and Foreign Keys

What does a primary key guarantee?

  • Each field contains unique values too
  • Each query returns the same data always
  • Each record is uniquely identifiable
  • Each table is linked to every other one
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