Friday, August 3, 2012

To Laugh or Cry (UPDATED)



Readers of my old site may remember the "To Laugh or Cry?" feature. It was a series of links to material to which it was difficult to decide which of the two reactions would be justified.

Note: Weekly Quotes and To Laugh or Cry? items are archived on two pages accessible from the top menu, so that they can be perused after the posts scroll.  

Here is the first link initiating the series here.  

Comment On SQL Split, The Daily WTF


It is excellent background for my forthcoming 3-part summary of the current issues in the database field. It warrants no further comment from me--just read those at the link--except that I suspect the SQL "guru" was paid by the hour.

One of the commenters mentions the two-paper combo by me and Chris Date on first normal form (available here).
Coyne: You're not the only one who don't get this, that's why the SQL standard allows [SQL to be embedded] in any number of procedural languages, to work around your deficient design.
SQL is a (roughly) relational language. If you're manipulating strings in it, you're Doing It Wrong. See
($$ but worth it) and the first few chapters of C. J. Date's AN INTRODUCTION TO DATABASE SYSTEMS.
But the bottom line is if you have "Mr. Smith" in your database and need access to "Mr." or "Smith", you should have split them into fields *before* they came into the database. The beauty of the relational schema is that, when properly normalized, all the informational complexity is clearly laid out: your database is exactly as complex as that schema looks. If you remove stuff or cheat to make it pretty, you are deluding yourself. If you do stupid tricks like entity attribute value, you have only hidden the complexity, but it's still there and will simply migrate to your app, usually in the form of a buggy rewrite of DBMS functionality.
Gee, what do you know, theory is practical!

UPDATE: Think about this in the context of what happened to the relational model and why so many blast it and why NoSQL happens: they see this sort of thing--for which the industry, SQL, its misusers and abusers and the educational system are responsible--and they equate it with the relational model. SQL was a big success, but it killed the real model and it is exactly what you would expect from operating not on knowledge and reason, but fads, trial and error and cookbooks. The lack of awareness of history causes constant reinventions of old wheels and regression.

No comments:

Post a Comment

View My Stats