Lecture 6: Tuple Relational Calculus

Title slideAnother day, another language. This one is the Tuple Relational Calculus for specifying queries that describe information to be extracted from the linked tables of a relational database. There’s a separation of roles here: the tuple relational calculus is good for succinctly stating what we want to find out; while relational algebra from the last lecture describes how to combine and sift tables to extract that information from the data. We distinguish what information we want from how to compute it.
Continue reading Lecture 6: Tuple Relational Calculus

Lecture 5: Relational Algebra

Title slideTuesday’s lecture presented a mathematical language for slicing and dicing the structured tables of the relational model: selection, projection, renaming; union, intersection, difference; cross product, join, equijoin and natural join. A key feature of this relational algebra is that just six of these operations are enough to capture an extremely wide range of queries and transformations of data. Database implementors work hard to build highly efficient engines to carry out these operations, which can then support many different kinds of user application.
Continue reading Lecture 5: Relational Algebra

Tutorial Solutions

Now that this week’s tutorials are over, I have posted solutions and notes on all the exercises to the course web pages. Click on the “Notes” field in the table of tutorials.

These notes are in much the same style as the solutions given to the exercises at the back of the tutorial sheets: they aren’t exactly “model” answers; rather, they outline some possible solutions and comment on where there might be trade-offs between alternatives.

Link: Tutorial Exercises

Lecture 4: From ER Diagrams to Relational Models

Now that we have both the high-level visual language of ER diagrams and the more formal structures of the relational model, this lecture presented some recipes for translating from the first into the second. This isn’t always an exact match, and for any particular ER diagram we might go back to its original source to decide how to best represent it as a relational model. Even so, this kind of step-by-step staging towards a fully formal representation is an effective route to capturing the subtleties of real-world systems.
Continue reading Lecture 4: From ER Diagrams to Relational Models

Lecture 3: The Relational Model

Title slideThis morning’s lecture introduced some refinements to the Entity-Relationship modelling of Lecture 2 and then set out the basics of the Relational Model for structured data. Where ER diagrams aim to give a conceptual language for describing things as they are, and have applications well outside databases for general organisation and management, the relational model is explicitly intended as a mathematically precise scheme for the computer-assisted building and querying of large datasets.
Continue reading Lecture 3: The Relational Model


This is the website for the first-year course Informatics 1: Data & Analysis. If you are interested in following the course then please come to the opening lecture on Tuesday morning.

Date: Tuesday 13 January 2015
Time: 1110–1200
Place: David Hume Tower (DHT) Lecture Theatre A

Note that the DHT Lecture Theatres are actually behind the Tower
itself in a distinct building.

Links: David Hume Tower (Map), Lecture Theatre A

Photograph of the entrance to the David Hume Tower Lecture Theatres
Picture credit: Matthew L., Yelp

Inf1-DA 2014–2015