October 13, 2010 at 9:09 am
Hi to every body
Suppose I have two entity X and Y that have the same definition
What is the best database design,Is to create tow tables one for x and other to y
Or to create one entity and add in this entity a flag column (bit type) that represent 'is x' or 'is y'
?????
Thanks
October 13, 2010 at 9:57 am
How is this any different from an 'employees' table with a 'gender' column recording 'm' or 'f'?
Do x and y have behavioral or processing differences? All the column datatypes and domains are the same?
October 13, 2010 at 12:14 pm
David Webb-200187 (10/13/2010)
How is this any different from an 'employees' table with a 'gender' column recording 'm' or 'f'?Do x and y have behavioral or processing differences? All the column datatypes and domains are the same?
My matter is I have two concepts 'Offer' and 'Sponsor' that I named them X and Y, but X and Y have same attributes (id, name, description)
but it's sure in business requirements X and Y two concepts have same attributes.
October 13, 2010 at 3:13 pm
bassam86 (10/13/2010)
Suppose I have two entity X and Y that have the same definitionWhat is the best database design,Is to create tow tables one for x and other to y
Or to create one entity and add in this entity a flag column (bit type) that represent 'is x' or 'is y'
Two entities, two tables - otherwise you will be adding unnecesary complexity to the model.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.October 13, 2010 at 3:18 pm
Yes, I'd have to agree with Paul. While the current set of attributes may be identical, they are drawn from different domains and I'd bet that there will be other attributes later on that would be specific to an offer or a sponsor.
2 tables.
October 14, 2010 at 6:09 am
If it's two really distinct entities, then, yeah, I agree with everyone else, two tables. From the names you gave, Sponsor & Offer, it sure sounds like two distinct entities. But we're not sitting in your chair.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply