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 > Design Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-03, 17:38
dwstudent2003 dwstudent2003 is offline
Registered User
 
Join Date: Oct 2003
Posts: 3
Smile Design Question

I have a question concerning setting up tables. I'm wondering why I would set up the tables in one way rather than the other way.

Example 1:

Users Roles Group
------ ------ -------
pk)UserID pk)UserID pk)GroupID
UserName pk)GroupID GroupName
Password

Example 2:

Users Group
------
pk)UserID pk)GroupID
UserName UserID
Password GroupName

Which one of these designs would be most efficient and why?
Can someone help me on this one.

Thanks,
DW
Reply With Quote
  #2 (permalink)  
Old 10-20-03, 08:10
andrewst andrewst is offline
Moderator.
 
Join Date: Sep 2002
Location: UK
Posts: 5,171
Re: Design Question

Example 2 doesn't seem to make sense to me: each group can only have 1 user in it? But if you meant to make UserID part of a composite PK with GroupID, then it still isn't good because GroupName is then denormalised.

So Example 1 is the way to go.
__________________
Tony Andrews
http://tinyurl.com/tonyandrews
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