| Author |
Topic |
|
monopolym4n
Starting Member
6 Posts |
Posted - 2011-05-03 : 18:46:10
|
| delete |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-03 : 21:10:22
|
Can you post what you have tried ?So that we can comment and give you feedback KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
monopolym4n
Starting Member
6 Posts |
Posted - 2011-05-03 : 21:20:20
|
| For the first table should each team have its own table? I have been reading up on converting them to 1NF since that is the first step to 3NF and seem to be stuck. |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-03 : 21:27:05
|
not really, if you take a closer look at Table 1, for a Team, is it possible to have more than 1 owner. So you can have 2 table there : Team & Owner and it is one to many relationship KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
monopolym4n
Starting Member
6 Posts |
Posted - 2011-05-03 : 21:35:28
|
| What would the columns be for each table? |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2011-05-03 : 21:40:26
|
Team- TeamID- TeamNameOwner- OwnerID- OwnerName- Year- PercentageOwned. . . KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
monopolym4n
Starting Member
6 Posts |
Posted - 2011-05-03 : 22:03:49
|
| For table 2 would I create 2 tables, one with columns TeamID, TeamName and for the second table use TeamID, Year, Wins, Losses, Champions? for columns? |
 |
|
|
Sqlraider
Yak Posting Veteran
65 Posts |
Posted - 2011-05-04 : 15:03:21
|
| You might consider Year to be Char(9) example '2009-2010' - this would be the playing season.Try this for Tables:Table1TEAM- TeamID- TeamNameOWNER- TeamID- OwnerID- OwnerName- Year- PercentageOwnedTable2SEASON- TeamID- Year- Win- Loss- ChampsTable3PLAYER- PlayerID- TeamID- YearPLAYERDEMOGRAPHICS- PlayerID- Year- Position- Hght- WghtPLAYERSTATS- PlayerID- Year- GameDate (DATE data type)- AmtScored- FT- ShotsTaken- Etc |
 |
|
|
Sqlraider
Yak Posting Veteran
65 Posts |
Posted - 2011-05-05 : 14:55:15
|
quote: Originally posted by monopolym4n this is my last question.. I need to write the SQL to bring up some reports from my database can someone give me a starting point? I just need the starting commands I should be able to connect the correct table/file names.Reports:First, he wants to be able to pull up a list of the teams that have won NBA championships and the year that they won it. He wants the teams that won most recently listed firstSecond, he wants to pull up a list of the teams that a given player has played on, as well as the years he played on that team. Simply write the SQL statement to accomplish this for ‘Lebron James.’ Order the list by year, most recent first. Be able to pull up a report which tells who owned the team that a given player played for in a given year. for ‘Stephen Jackson’ in ‘2009.’
He? Boss or Prof?What have you tried so far?Starting Point: use SELECT, WHERE, ORDER BY. Look at BOL on how to use these. |
 |
|
|
|