in reply to (OT) Why SQL Sucks (with a little Perl to fix it)

I read a fair chunk of Date and Darwen's "The Third Manifesto" where they describe what they want from a real relational database. It's great stuff but in order to get there it requires things that current RDBMs don't do and which are probably reasonably difficult to bolt on after the fact. Things like tuple-valued columns. That is having not just integer, varchar etc but also being able to do the equivalent of
CREATE TABLE friends (Nickname VARCHAR(40), Name (First VARCHAR(20), L +ast Varchar(20))
which would be great. You'd be able to use Name as the primary key even though current RDBMs would do it as 2 columns. You could
SELECT * FROM friends WHERE Name=('John', 'Smith')
and maybe even
SELECT * FROM friends WHERE Name.First='John'
but there are other interesting effects like for example what do you get with
SELECT Nickname FROM friends WHERE Name.First='John'
if 2 Johns have the same Nickname? Well you should get a list of nicknames without duplicates, but now the size of the result set is no longer equal to the number of Johns you know. SELECT Nickname, Name will give you a different number of row. So the query's behaviour now depends not just on the WHERE clause but also on the columns you've requested. Which could be confusing.

It's interesting to note that while Date is very critical of SQL, he is (or was) a member of the standards committee. DB Debunk has more of Date's writings. Even if a truly relational database doesn't become a reality in the next 10 years, reading about what it would be like, why it should be like that and what's broken about the current crop can only improve your database-foo.

Replies are listed 'Best First'.
Re^2: (OT) Why SQL Sucks (with a little Perl to fix it)
by Ovid (Cardinal) on Dec 11, 2005 at 02:34 UTC

    After I finish this book, I really need to read "The Third Manifesto". I think I'll take a break with Harry Potter first, though :)

    Cheers,
    Ovid

    New address of my CGI Course.

      It's not an easy read. I stopped about half way through and never got back to it. There are parts I disagreed with, like their analysis of inheritance and the need to have a 2 separate imperative languages, one to deal with data definition and the other for application programming but it's got lots of interesting ideas in it. I got it from halfpricecomputerbooks or something like that for $10!