Saturday, February 19, 2011

SQL and the Third Manifesto

I've been poking around with relational algebra a bit lately, and came across the supposedly infamous "Third Manifesto", a paper from 1995 which argues "unequivocally" for the elimination of SQL. Authors Hugh Darwen and C.J. Date say that SQL is a barrier to achieving the "true" Relational Model, put forth by E.F. Codd in 1969. They give several reasons, not least of which are SQL's tolerance for NULL values, duplicate rows, and the need for a user to manage the order of columns (for example, when doing an insert). They propose a language "Tutorial D", along with a set of prescriptions for authentically representing a relational model.

Dave Voorhi developed an implementation of Darwen and Date's "Tutorial D", called "Rel". I decided to download it and play around to see how it works. Coming from the SQL world, I thought I'd give some brief comparisons.

To demonstrate the differences, I will create a "zoo" database in MySQL and Tutorial D. The database consists of animals, which are members of a zoo. Each animal must also belong to a species.

Creating Relations


Tutorial D

Inserting Tuplets


Tutorial D

Also, inserting NULLs in Tutorial D is forbidden. So while this works in SQL

Tutorial D complains.

Selecting data


Tutorial D



Tutorial D

Running a similar query in SQL will return multiple rows, rendering the result meaningless.

I gotta say, SQL is indeed quite clunky. How can I get in on this manifesto! But Google searches to dig further return nothing but expired pages. Even finding the "Third Manifesto" was tricky. Why isn't there more interest in this subject?

Fortunately, there are a couple of useful links to better grasp Tutorial D's syntax.

Hugh Darwen's book, "An Introduction to Relational Database Theory" (free to download)

Ahmed Yusuf Almull's dissertation on translating between SQL and Tutorial D

Rel's download page

1 comment:

  1. I have an impresion that Tutorial D is not well received in academic database community where Prolog and Datalog are kings.