Lecture 6: Tuple-Relational Calculus

Another language, this time 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 precisely stating what we want to find out; while relational algebra from the last lecture well describes how to combine and sift tables to extract that information from the data. We can distinguish what information we want from how to compute it.

The lecture slides have a series of examples of queries written in the tuple relational calculus, together with matching relational algebra terms to carry out the computation. Watch the video to find out more about tally sticks and Facebook Graph Search, as well as Charles V, his horse, and domain-specific languages.

One of the result tables in the slides was incorrect at the lecture, and I’ve now fixed that in the version posted on the course web page and NB.

Homework

Tuple-relational calculus can be quite tricky to understand, and it’s not always obvious to follow how to implement particular queries in relational algebra. So, homework this time is to read the lectures slides again, going through the examples to follow how each query works. If you have questions, post them on the NB copy of the slides.

References

Here are links to some of the various sources indicated in today’s lecture.

This entry was posted in Lecture log. Bookmark the permalink.