In the holiday season, white elephant gift exchanges are somewhat popular in the workplace. This is a really great definition from Wikipedia: "the term white elephant refers to a gift whose maintenance cost exceeds its usefulness." Now that definitely describes some databases I've seen!
We can do a white elephant gift exchange of worst schemas. Here's my white elephant constructed of snippets from real production databases:
create table [table] (
[column] varchar(1) --think Hungarian notation without abbreviations
, [count] decimal(10,0) --integer value that might someday be 3 billion
, replicationId varchar(40) --this was for storing a uniqueidentifier
, acomodation varchar(50) --can we add spellcheck to SSMS, please?
, seperationStatus varchar(50) --odd how many columns match the default length
, worseThanEAV xml
Do you hate brackets? I do! I really hate brackets when people use them to allow keywords and reserved words to be used for other purposes. I can see someone specifying decimal(10,0) instead of int, but other evidence made me suspect that the person didn't understand data types at all. Object names that are misspellings of ordinary words tend to cause the literate members of the staff to make errors. Don't you wonder about the design of a database in which most varchar columns are the same as the default width?
I really liked the varchar(1) that I saw in a table definition. I can't wait to hear the justification for that.
There was a recent blog post on EAV and quite a bit of discussion on that topic. The xml data type is a good companion to discussions about EAV. If you just can't quite finish your data model, be it third normal form or EAV (notice that the word normal is never used with the abbreviation EAV - ponder than one for a bit), you can always organize your data as XML and cram it into a table.