in reply to (OT) Why SQL Sucks (with a little Perl to fix it)
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 couldCREATE TABLE friends (Nickname VARCHAR(40), Name (First VARCHAR(20), L +ast Varchar(20))
and maybe evenSELECT * FROM friends WHERE Name=('John', 'Smith')
but there are other interesting effects like for example what do you get withSELECT * 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.SELECT Nickname FROM friends WHERE Name.First='John'
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 | |
by fergal (Chaplain) on Dec 11, 2005 at 21:51 UTC |