Transactions
The definitions, normal forms and transaction properties that exam questions test
Computer Science | Undergraduate (Level 5) | December 2026
WHAT IS INSIDE
1. The relational model
2. SQL and relational algebra
3. Functional dependencies and normalisation
4. Transactions, concurrency and indexes
Exam question patterns
Glossary of exam-ready definitions
1. The relational model
A relation is a set of tuples over a schema of named, typed attributes; because it is a set, duplicate tuples are
impossible and tuple order carries no meaning. A superkey uniquely identifies a tuple, a candidate key is a
minimal superkey, and the primary key is the candidate key chosen for identification. A foreign key
references a candidate key in another relation and enforces referential integrity: its value must exist there or be
null where permitted.
Integrity constraints are declared, not assumed: entity integrity forbids null primary keys, referential integrity
forbids dangling references, and domain constraints restrict values to their type. The important exam distinction
is between the schema (the stable structure) and the instance (the current data), because constraints are stated
on the schema and evaluated on the instance. Relational design also explains why a table without a declared key
is not a relation in the formal sense, however it looks in a spreadsheet.
• Degree and cardinality - degree is the number of attributes, cardinality the number of tuples.
• Null - unknown, not applicable or withheld; comparisons with null yield unknown, never true.
• Referential action - restrict, cascade or set null defines what happens on deletion of a referenced row.
• View - a stored query; a materialised view trades storage and staleness for read speed.
2. SQL and relational algebra
Relational algebra is the formal basis: selection filters rows, projection chooses columns, cartesian product
pairs rows, join pairs rows matching on a condition, and set operations combine compatible relations. SQL
adds duplicate retention, ordering and aggregation, so a SQL query is not identical to an algebraic expression
until duplicates are removed. Exam questions typically ask you to translate between the two; translate
projection last, because the algebra collapses duplicates on projection while SQL does not without DISTINCT.
The clauses are evaluated in a fixed logical order: FROM, WHERE, GROUP BY, HAVING, SELECT,
ORDER BY. That order explains why an alias defined in SELECT cannot be used in WHERE, and why
filtering an aggregate needs HAVING rather than WHERE. Outer joins preserve unmatched rows with nulls,
and the classic error is turning an outer join back into an inner one by testing a column of the optional side in
WHERE instead of in the join condition.
• Aggregate functions - COUNT, SUM, AVG, MIN, MAX; COUNT(*) counts rows while COUNT(column)
ignores nulls.
• Subquery forms - scalar, IN, EXISTS and correlated; EXISTS stops at the first match, which matters for
performance.
Databases: Relational Model, SQL, Normalisation and Transact Page 1 of 3