Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2006
    Location
    San Francisco, CA
    Posts
    136

    How does my diagram look?

    Hey guys,
    I am trying to create a general db which can be used for general login purposes; a person will fill out a registration form and register for a site. Please have a look over my diagram and tell me what you think about it. Is it well built? Am I missing something? Did I use all the right relationships and data types, etc? I am trying to learn good database design, so please feel free to criticize.

    A little background info:
    Username is unique
    All relationships are 1 to 1

    Thanks
    Reghardt
    Attached Thumbnails Attached Thumbnails Login.JPG  

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    your relationships aren't 1 to 1

    it all looks fine, assuming you really do intend to allow multiple users to have the same login, or one user to have muiltiple logins, or to allow a single user to have multiple positions, or the same user to belong to multiple companies

    you have 3 "Link" tables -- remove the existing PKs (auto_increments?) and make the PK a composite key consisting of the other two columns
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Aug 2006
    Location
    San Francisco, CA
    Posts
    136

    oops

    Wow I feel stupid.
    Anyways I guess that is all apart of learning. I made some corrections so check it out now.
    Attached Thumbnails Attached Thumbnails Login.JPG  

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    don't be so hard on yourself

    that looks great, now, but i'm wondering why user and login are still separate (i wasn't sure what the key going in both directions means)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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