If all records in both tables will have the same DealID between rows, do it the first way. No point in storing the same information twice. Just make sure you don't leave orphan records between the two. You can set up the database to have a casading delete
between the two tables if you need it that way.
Marked as answer by sephiroth100 on Jun 01, 2012 02:01 PM
sephiroth100
Participant
1118 Points
1001 Posts
Which of these is the better practice?
May 31, 2012 01:38 PM|LINK
A noob question.
Suppose I have 2 tables where 1 is an associate of the other, lets call them Deals and DealTerms.
Is it better to do this:
tblDeals
DealId
tblDealTerms
DealId
and have a relationship between DealId and DealId
or this:
tblDeals
DealId
DealTermsId
tblDealTerms
DealTermsId
and have a relationship betweeb DealTermsId
Thanks.
mth13
Member
331 Points
96 Posts
Re: Which of these is the better practice?
May 31, 2012 02:40 PM|LINK
If all records in both tables will have the same DealID between rows, do it the first way. No point in storing the same information twice. Just make sure you don't leave orphan records between the two. You can set up the database to have a casading delete between the two tables if you need it that way.