Relational Databases and SQL
Aligned to the AQA 8525 specification
- Level
- Intermediate
- Reading time
- 8 min
- Published
- 8 June 2026
- Updated
- 1 July 2026
On this page
Key takeaways
- A relational database stores data in one or more linked tables; a field is a column (one attribute), a record is a row (all data for one entity), and a data type is the type of value a field holds.
- A primary key uniquely identifies each record in its own table and can never be NULL; a foreign key is a field holding another table's primary key value, creating a link between the tables.
- SQL clauses must be written in a fixed order: SELECT then FROM then WHERE then ORDER BY; writing them in the wrong order is a syntax error.
- UPDATE and DELETE without a WHERE clause affect every row in the table, so always include WHERE to target the correct records.
- To query two tables, list both in the FROM clause and match the primary key to the foreign key in WHERE, using dot notation like Students.Name where field names are shared.
Studying this for an exam?
Generate a personalised learning path for this subject. Free to get started.
Key terms
- Relational database
- A database that stores data in one or more tables which can be linked to each other.
- Table
- A collection of related data organised into rows and columns.
- Field
- A column in a table representing one attribute of the entity.
- Record
- A row in a table containing all the data for one entity.
- Primary key
- A field (or combination of fields) whose value is unique for every record in a table and can never be NULL.
- Foreign key
- A field in one table that contains the primary key value from another table, creating a link between the two.
- SQL
- Structured Query Language, the language used to interact with relational databases.
- ORDER BY
- An SQL clause that sorts query results by one or more fields, ascending (ASC) by default or descending (DESC).
Frequently asked questions
A primary key uniquely identifies each record within its own table and can never be NULL. A foreign key is a copy of another table's primary key, stored in the table that references it, and is used to link the two tables together.
The required order is SELECT, then FROM, then WHERE, then ORDER BY. Writing them in any other order, such as WHERE before FROM or ORDER BY before WHERE, is a syntax error and scores zero for that query.
Without a WHERE clause, UPDATE changes every record in the table and DELETE removes every record permanently. The WHERE clause targets only the specific records you intend to modify, so it should always be included on these commands.
Generate revision on any topic you study
Type any topic you're studying and Aicademy generates a complete lesson, quiz, and flashcard set, personalised to your level.
Lessons on anything
Structured, level-matched lessons on any topic you study
Practice quizzes
Find out what you actually know before the exam does
Flashcard sets
Lock in key concepts with instant revision cards
Ask Aica
Stuck on something? Get a clear explanation, any time
Cyber Security: Threats and Defences
Ethical, Legal and Environmental Impacts of Digital Technology
Related lessons
9 min
9 min