Reputation: 595
I'm confused on whether I should combine two tables or leave them separated. The ff is just one set of that problem of mine:
tblPhone(Phone_ID, Phone_Number, Phone_Type_ID, Person_ID)
tblPhone(Phone_Type_ID, Phone_Type_Name)
or
I should simply have it as:
tblPhone(Phone_ID, Phone_Number, Phone_Type_Name, Person_ID)
Does one have advantage over the other? Is there like a standard guideline or practice for table creation? For example, I remember someone telling me if a table isn't 3 or more, just combine it to another table, something like that...how true is that? I remember a little bit of normalization rules...but it can be very confusing at times. I think this falls on the third normalization rule that's why they should be separated, am I mistaken? Thanks!
Upvotes: 1
Views: 49
Reputation: 270697
You are correct that this illustrates the third normal form.
You are normalizing the Phone_Type_Name
out of tblPhone
(we assume you mean to call the second tblPhoneType
). This is correct and a common practice. Even if you have just two columns in tblPhoneType
now, eventually you may need to expand it to include other attributes related to phone types, and that is the easiest way to illustrate why you should normalize it.
By normalizing it now, you have protected yourself against this:
tblPhone(Phone_Type_ID, Phone_Type_Name, Phone_Type_Min_Price, Phone_Type_Max_Price)
Upvotes: 1