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 > beginner - needs feedback on simple database design

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-24-07, 15:13
ra64 ra64 is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
beginner - needs feedback on simple database design

This is a database I made for a project, any feedback is appreciated. Is setting up the handPlayed and Bet tables like this bad design? I rarely see designs set up like this. Is there a better way to do it without sacrificing too much performance (which is important for this application). thanks.

db_relationships.GIF
Reply With Quote
  #2 (permalink)  
Old 03-26-07, 12:56
loquin loquin is offline
Super Moderator
 
Join Date: Jun 2004
Location: Arizona, USA
Posts: 1,797
I would probably make the Bet table a child of the HandPlayed table.
It's PK would be HandNum, PlayerNum, and BetNum. (BetNum would begin with 1, and increment for each Player/Bet number.) HandNum and PlayerNum would be fk's to HandPlayed.

PlayerNum 1, HandNum 1, BetNum 1, type, amount...
PlayerNum 2, HandNum 1, BetNum 1, type, amount...
...
PlayerNum 1, HandNum 1, BetNum 2, type, amount...
PlayerNum 2, HandNum 1, BetNum 2, type=fold, 0, ...

I think that this probably models the game better than two, discrete intersection tables.
__________________
Lou
使大吃一惊
"Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
"I have my standards. They may be low, but I have them!" - Bette Middler
"It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Reply With Quote
  #3 (permalink)  
Old 03-26-07, 22:13
ra64 ra64 is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
thanks for the help.

will this change effect the performance? for better or worse? probably not?

does my original design break any basic normalization rules? Its in 3rd normal form - right?

sorry, I'm getting burnt out on this, can't think straight anymore
Reply With Quote
  #4 (permalink)  
Old 03-28-07, 00:55
ra64 ra64 is offline
Registered User
 
Join Date: Mar 2007
Posts: 8
i noticed holecardrank is dependent on holdcards, so this is not in 3nf. this is not really important, I'll probably remove the holecards attribute, i don't use it anymore.

I can't decide if i want to change to the alternative design or not. What would be the difference if I want to do a query like, select all bets for a player?
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