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.


In reply to Re: (OT) Why SQL Sucks (with a little Perl to fix it) by fergal
in thread (OT) Why SQL Sucks (with a little Perl to fix it) by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.