Associate
- Joined
- 31 Dec 2002
- Posts
- 458
Hi,
I am struggling with a data model for a contacts database. There is a requirement for the following:
Contact: First Name, Last Name
Contact Type: Associate, Friend, Business Contact
Communication Method: Email, Landline Phone, Mobile Phone
I have come up with two tables for the model so far:
Contact: PK Contact_ID, First Name, Last Name, Landline, Mobile, Email
Contact Type: PK ContactType_ID, Contact Type
The Contact Type Table would be a lookup table only. I am not happy with this design as there would be the possibility of the contact not having landline, mobile and email. They may only have one, two or all three. There may be empty fields as a result, which I understand is bad practice. Normalisation is quite new to me. Would it be better to have three or more tables and split out the phone and email into a new table?
I would say in regards to relationships that one contact can have many contact types, and one contact can have many communication methods.
Any help appreciated.
I am struggling with a data model for a contacts database. There is a requirement for the following:
Contact: First Name, Last Name
Contact Type: Associate, Friend, Business Contact
Communication Method: Email, Landline Phone, Mobile Phone
I have come up with two tables for the model so far:
Contact: PK Contact_ID, First Name, Last Name, Landline, Mobile, Email
Contact Type: PK ContactType_ID, Contact Type
The Contact Type Table would be a lookup table only. I am not happy with this design as there would be the possibility of the contact not having landline, mobile and email. They may only have one, two or all three. There may be empty fields as a result, which I understand is bad practice. Normalisation is quite new to me. Would it be better to have three or more tables and split out the phone and email into a new table?
I would say in regards to relationships that one contact can have many contact types, and one contact can have many communication methods.
Any help appreciated.
) . I probably have some coding habits which other developers would probably critique as well which are annoying/irritating. )
for some reason I am finding normalisation and databases difficult, in that it is taking quite a while to sink in. I don't mean it should be easy, as relational theory is beyond me at the moment and I know databases is a very deep topic.