DM26, Fall 2005 - Weekly Note 3


Lecture September 21

More on relational algebra. Basic SQL queries.

Reading

Ramakrishnan and Gehrke: Section 4.2, and 5.1-3.

Remarks

We will skip the sections on the relational calculus (Section 4.3-4), as SQL is based mainly on relational algebra, not the relational calculus. The relational calculus is another classic formalism for expressing queries (i.e. generating new relations from existing ones). Contrary to the relational algebra, the formalism is descriptive rather than operational - the contents of the new relation is specified, but not how to generate it. It is a classic result that the two formalisms have the same expressive power, i.e. can generate the same sets of relations.

Each vendor of DBMS's implements a slightly different version of SQL. In this course, we will be using PostgreSQL, which comes with ample online documentation, including a description of its SQL language. Other sources of information on SQL are numerous tutorials on the web, as well as textbooks specifically on SQL. Use your favorite search engine to find such items.


Lecture September 28 (expected contents)

More on SQL (advanced queries, definition of relation schemes, update of relation contents, constraints, triggers, views).

Reading

Ramakrishnan and Gehrke: Rest of Chapters 3 and 5 (you can skip 3.8).


Exercises September 28/30

Exercises 3.16 (except the question in the last paragraph), 4.2, 4.3 (only the relational algebra versions of the queries) and 4.4 in Ramakrishnan and Gehrke. Any remaining exercises from previous exercise classes.


Maintained by Rolf Fagerberg (rolf@imada.sdu.dk)