Go Back   SitePoint Forums > Forum Index > Program Your Site > Databases
Newsletter FAQ Members List Calendar Mark Forums Read

New to SitePoint Forums? Register here for free!

SitePoint Sponsor
 
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old Feb 21, 2006, 07:23   #1
ClickHeRe
SitePoint Evangelist
 
ClickHeRe's Avatar
 
Join Date: Mar 2005
Location: Ottawa, Canada
Posts: 580
Table Normalization Help

Ok I'm trying to build an experimental hockey league system for fun. I'm trying to get the database design down and this is what I have so far :

-------------
* Season Table

season_id | season_name

* Teams Table

team_id | season_id | team_name | division_id

* Divisions Table

division_id | season_id | division_name | division_rank

* Players Table

player_id | season_id | team_id | player_surname | player_name | player_is_goalie

* Game Table

game_id | season_id | division_id | team_id1 | team_id2 | goalie_player_id1 | goalie_player_id2 | game_date | rink_id

* Rink Table

rink_id | season_id | rink_name | rink_map

* Stats Table

stats_id | season_id | game_id | team_id | goal_player_id | ***_player_id1 | ***_player_id2 | goal_time | goal_attrib

* Penality Table

penality_id | season_id | game_id | player_id | pen_time

* Suspension Table

suspension_id | season_id | player_id | suspension_end_date

-------------

If the tables are not properly normalized, I'd like advice to improve the overall to reduce complexity on the queries.

Now, I'm no SQL expert.

I'd like to get list the scorers/assists for each team with their names from the player table for a particular game.

Also, I'd like to get a team overall stats for example. How many goals they scored and how many they got scored for the entire season using the games table and stats table with their team_id.

Thanks
ClickHeRe is offline   Reply With Quote
 

Bookmarks

« Previous Thread | Next Thread »

Thread Tools
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 On
HTML code is Off
Sponsored Links
 
Forum Jump


All times are GMT -7. The time now is 01:43.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright 1998-2009, SitePoint Pty Ltd. All Rights Reserved