View Single Post
Join Date: Nov 2008
Posts: 822
Reputation: verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough verruckt24 is a jewel in the rough 
Solved Threads: 73
verruckt24's Avatar
verruckt24 verruckt24 is offline Offline
Practically a Posting Shark

Re: Creating a database

 
0
  #5
Dec 8th, 2008
Yes I recommend that too since I am not able to read your design properly due to confusing names. I would be in a better position to tell you your way around once I am clear with your database design.
I present here my suggestions from whatever I have understood of your db design :
1. What exactly are you achieving by placing a phoneNo_Id in the contacts table that refers to a phoneNumber in the master table ?
Ans : Nothing.
You could have as easily place the phone number itself in the contacts table.
2. Do you really think a phone number requires a unique identification ?
Ans : No. (You may think o/w but it doesn't really require)
Isn't a phone number unique enough by itself - (the phone company certainly would not allocate the same phone number to two different persons)

You are doing the same thing in the case of the Addresses. Check your design, by actually creating a different table for address and then putting an Id for that address you aren't allowing a contact to have multiple addresses whereas that's the exact thing that the professor asked you to do.

Based on this observations I feel that you have not correctly understood the concept of normalization of database. Reading these concept is central to being a good db designer, I would recommend reading the same. Any good db book would have an explanation for them.

I explain here what instead you should have done to allow multiple phone numbers and addresses for a single contact. This is supposed to provide you an insight into where you are going wrong.
To understand the design, Contacts and addresses have a one-many relationship since a single contact can have multiple addresses. In such cases you always create another table for the entity that represents "many" and put an Id for the entity that represents "one" wherever you want to link the two.
For e.g. You have a ContactId field in the Address table and put in the Id for the Contact whenever an address for that particular contact is inserted. This way you would be able to store multiple addresses for the same contact.
Last edited by verruckt24; Dec 8th, 2008 at 4:07 am.
Get up every morning and take a look at the Forbes' list of richest people. If your name doesn't appear.... GET TO WORK !!!
Reply With Quote