Every developer has a copy of SQL Server on there desktop for prototyping...
DBA: What can I do for you guys?
DEVELOPERS: We've created a couple of tables and we are getting duplicates
DBA: Why don't you have a key?
DEVELOPERS: We do!
DBA: No you don't
DEVELOPERS: Yes we do, this column here is an identity column with a primary key constraint.
DBA:................(twiddles thumbs)............
DEVELOPERS: Ohh, I see what you are saying..its not a key at all.
A back and forth takes place discussing business requirements and FD's.
DBA: So, given all our rules, these 4 columns combine to give us the simpliest key.
DEVELOPERS: Yes, but won't that be a performance impact on the Insert?
DBA: Take your pick gentlemen, expensive truth or cheap lies?
DEVELOPERS: .....(Silence)......
DBA: What does this other table do?
DEVELOPERS: That's a "look up" table for the type of the row.
DBA: Why is it a table then?
DEVELOPERS: What?
DBA: Why have you turned a type into a relation?
DEVELOPERS: Because we want to allow only these values.
DBA: That is what a domain is, we will simply add a CHECK constraint to enforce those values and completely remove that table.
DEVELOPERS: But what happens when we want to add more values?
DBA: How often do you think that will happen?
DEVELOPERS: Not very often.
DBA: Then I will alter the CHECK constraint when required.
DEVELOPERS: That's a great idea! No more joins on this table.
DBA: Any time fellas....
Print | posted on Tuesday, February 17, 2004 9:07 AM