If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > How does my diagram look?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-07-06, 18:03
Reghardt Reghardt is offline
Registered User
 
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
How does my diagram look?-login.jpg  
Reply With Quote
  #2 (permalink)  
Old 08-07-06, 18:58
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 08-09-06, 19:52
Reghardt Reghardt is offline
Registered User
 
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
How does my diagram look?-login.jpg  
Reply With Quote
  #4 (permalink)  
Old 08-09-06, 20:03
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
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)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On