Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2005
    Posts
    2

    Trouble understanding how relationships work

    Greetings,

    I am just starting out in web development and database design and I am having a difficult time understanding the back end design of my applications. For example, here is a small sample of a database I have been working on.

    COMPANY(company_id, name, address, city, state, zipcode)

    CONTACT(contact_id, first_name, last_name, phone_number, position, email_address)

    COMPANY_CONTACT(company_id, contact_id)

    I think I understand the many-to-many relationship where you have to create a 3rd table and link them all together as illustrated above. However, I am having a hard time figuring out how this information would be updated from a front end perspective. For example, on a front end web page I would gather all of the information for the company and contact tables and update them but how would the information in the company_contact table be updated? Does this information update automatically due to the relationship created or would it need to be updated in addition to the other two tables? I'm sorry if this seems like a stupid question but I can't seem to wrap my mind around that concept.

    Also, I have searched for a good online article about this topic but haven't really found anything good yet. I have also considered purchasing a book but they all seem very advanced, dry, and boring. Can anybody recommend a good data modeling/database design book for a beginner that might help me understand more?

    Thanks in advance for any suggestions.

  2. #2
    Join Date
    Sep 2005
    Posts
    22
    If you look up Alf Pedersen on the net (http://www.databasedesign-resource.com/) he has PDF articles on Entity Relationship, Primary Keys, Normalisation etc which are useful and easy to understand. If you sign up for the newsletter you can download the E-R book free. The Primary Keys book is free and there is a lot of other information on the site which may be of use to you.

    However you do need a good book.

    Re Contact:Company

    If it is really M:M then your design will run into trouble as Contact defines position,email,phone which seem to have to do with Company-Contact rather than Contact.

    Bill

  3. #3
    Join Date
    Nov 2005
    Posts
    2
    Bill,

    Thank you for the reply and the links. I will check those .pdf documents out and hopefully they can help me understand a little better.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •