C-526 Databases: Course Home Page 2011-12 Session

General Information about the course

The entire course will be taught by Peter McBrien, and comprise of three hours per week of combined lectures and tutorials. There will be two written courseworks.

Lecture Slides

The slides are placed here at the time of the lecture. Note that the course content is what is presented verbally during the lectures: you are expected to attend all lectures.

  1. Introduction
  2. Relational Algebra
  3. SQL: An implementation of the RA Optional Lab Exercise on SQL, with solutions
  4. SQL: A Language for Database Applications
  5. Datalog
  6. ER Modelling
  7. Functional Dependencies and Normalisation
  8. Concurrency Control
  9. Recovery
Tutorial sheets with selected answers

Slides from 2010-11

To give a overview of the content of the course, the slides from last year are given here.
  1. Introduction
  2. Relational Algebra
  3. Datalog
  4. SQL: An implementation of the RA
  5. SQL: A Language for Database Applications
  6. ER Modelling
  7. ER to Relational Mapping
  8. Functional Dependencies
  9. Normalisation
  10. Concurrency Control
  11. Recovery

Example Databases

There are four relational databases used in the course for examples, and these four databases are made available for running example queries on both SQL Server and Postgres.

Further examples to download into your own database are found in my databases tools and data mini site.

Examples hosted on a Microsoft SQL Sever 2008 DBMS

To connect to the databases hosted on SQL Server, issue commands in the following form on a CSG Linux machine (and using password 'lab'):

sqsh -S sqlserver -D lab_bank_branch -U lab

Once connected, queries may be entered, terminated by \go. Help on the environment may be found using \help.

The sqshrc file may be copied as .sqshrc in your home directory, and altered to change the default behaviour of sqsh. This file should by default be also present as /etc/sqshrc on CSG Linux machines, but may be absent from recent Ubuntu installations.

Note that this version of SQL Server does not support the various three valued logic tests IF UNKNOWN, IF NOT FALSE, etc. It has been set to use ANSI handling of NULL equality tests.

Examples hosted on a Postgres DBMS

To connect to the databases hosted on Postgres, issue commands in the following form on a CSG Linux machine (and using password 'lab'):

psql -h db -U lab -d lab_bank_branch -W

Once connected, queries may be entered, terminated with a semicolon. Online help may be accessed with \help, and \exit used to exit the psql tool.

Note that this version of Postgres does not support CUBE or ROLLUP.