Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Database Design help

Author  Topic 

monopolym4n
Starting Member

6 Posts

Posted - 2011-05-03 : 18:46:10
delete

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-05-03 : 19:39:52
I've got excellent eye sight and even I can't read them. And you can't click on them to enlarge them. Help us help you, please.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

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]

Go to Top of Page

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.
Go to Top of Page

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]

Go to Top of Page

monopolym4n
Starting Member

6 Posts

Posted - 2011-05-03 : 21:35:28
What would the columns be for each table?
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-05-03 : 21:40:26
Team
- TeamID
- TeamName

Owner
- OwnerID
- OwnerName
- Year
- PercentageOwned
. . .


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

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?
Go to Top of Page

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:

Table1
TEAM
- TeamID
- TeamName

OWNER
- TeamID
- OwnerID
- OwnerName
- Year
- PercentageOwned

Table2
SEASON
- TeamID
- Year
- Win
- Loss
- Champs

Table3
PLAYER
- PlayerID
- TeamID
- Year

PLAYERDEMOGRAPHICS
- PlayerID
- Year
- Position
- Hght
- Wght

PLAYERSTATS
- PlayerID
- Year
- GameDate (DATE data type)
- AmtScored
- FT
- ShotsTaken
- Etc
Go to Top of Page

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 first

Second, 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.
Go to Top of Page
   

- Advertisement -