Tutorial Exercises

Exercises for Tutorial 4 are on the tutorial page. These involve writing and executing SQL queries using the LibreOffice Base desktop application. This is installed on all DICE machines, and the tutorial includes detailed usage notes: using DICE is probably the simplest way to complete the tutorial. It is also possible to do the exercises on university open-access machines or your own computer, and there are some instructions to help with that.

This tutorial includes more substantial starred extension exercises to try out other ways to access the same database.

  1. Setting up queries using the LibreOffice Base graphical query designer.
  2. Connecting on the command-line to a remote PostgreSQL database server.
  3. Linking LibreOffice Base to the remote database server.

Lecture 10: Structuring XML

Title slide

Slides : Recording

Every well-formed XML document is neatly arranged as a tree, with names for element nodes and all their attributes. This is enough for basic tools to correctly transmit and process XML; but for many applications it is useful to add more precise domain-specific constraints that we expect documents to satisfy. For this we have XML schema languages: specialised languages for describing types of XML document. This lecture covered one in particular, the Document Type Definition language DTD.
Continue reading Lecture 10: Structuring XML

Festival of Creative Learning

As noted in Tuesday’s lecture, next week gives a break from all classes with the University’s Festival of Creative Learning. There’s a cascade of events at the calendar and blog; I’ve just picked out a few here that I liked.

Links: Festival home page; Event calendar; Blog

Picture of baked goods Mathematical Bake-Off
Monday 20 February

“Leading mathematicians from the School will explain their cutting-edge research using delicious pastries”

Links: Book event; More information

Workshop poster Data and Democracy
Monday 20 February

Data collection and digital footprint; workshops on mass surveillance, anonymity and advertising.

Links: Book event; More information

Escape with Fermat’s Lost Proof
Wednesday 22/Thursday 23 February

Find the missing proof and escape the locked room.

Links: Book Wednesday; Book Thursday; More information

Escher tesselation
From www.mcescher.com
Exploring Escher: Mathematical Printmaking
Wednesday 22 February

Create your own linocut prints.

Link: Book event

Lecture 9: Trees and XML

Title slide

Slides : Recording

From the strict rectangles of structured data to the more generous triangles of semistructured data. This morning’s lecture gave an overview of what kind of data is seen as “semistructured”; the idea of trees as a mathematical model of data; the particular form of trees in the XPath data model; and their textual representation in XML — the Extensible Markup Language.

XML also has a large number of domain-specific variants. These are all valid XML, and use standardised sets of element types to give a custom language for representing data relevant to a particular field: from musical scores to financial trading.
Continue reading Lecture 9: Trees and XML

Lecture 8: SQL Queries

Title slide

Slides : Recording

Today was the final lecture on Structure Data and covered a range of database topics: ACID properties for transactions; the NoSQL movement; nested SQL queries, set operations, and aggregate queries; ultimate physical limits to computation; the wonders of the heavens captured in SkyServer; and the idea of doing scientific research and experiments from inside the database.
Continue reading Lecture 8: SQL Queries

Tutorial Notes and Exercises

Tutor notes and solutions for Tutorial 2 are now on the tutorial page, together with next week’s exercises. Tutorial 3 is about formulating queries in tuple relational calculus and finding ways to compute them in relational algebra.

Have a look at the exercises now, and if you have questions about anything then ask on Piazza or after lectures.

Lecture 6: Tuple Relational Calculus

Title slideToday, another language for talking about databases. This one is the Tuple Relational Calculus for writing 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