• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 1 out of 3 pages
Summary

Summary Databases: Relational Model, SQL, Normalisation and Transactions

Document preview thumbnail
Preview 1 out of 3 pages

Revision summary for a second-year Databases module, covering the relational model and integrity constraints, SQL and relational algebra including the logical evaluation order that explains most query errors, functional dependencies and normalisation from 1NF to BCNF with the lossless join test, and transactions with ACID, isolation anomalies and indexing. Every definition is stated in the form a marker expects, and the worked details focus on the common failures - NOT IN with nulls, outer joins collapsed by WHERE, phantom reads, and indexes made unusable by a function on the column. Includes a normal form table, four practice questions with checkpoints, a glossary and a revision plan.

Content preview

Databases: Relational Model, SQL, Normalisation and
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

Document information

Study
Unknown
Uploaded on
December 1, 2026
Number of pages
3
Written in
2026/2027
Type
Summary
$7.98

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
225
Last sold
-



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions