Database
For this discussion, I will use a sport I play every weekend which is softball. The softball board wants a database that captures team, player, and sponsor information. From what I can tell I’ve separated the tables into 1NF. I look forward to feedback on this because I’m not quite sure I fully understand the process. I've attached my ER diagram for reference.
team (team_id, team_name, division, coach_first_name, coach_last_name, stats, business_name)
· The team table above will be used to capture information relating only to the team itself. The primary key will be team_id. Each team has a sponsor, so the foreign key is business_name. The team has a one to one or many relationships with Sponsor. One sponsor can have many teams. Also, a team has a one to many relationships with players. One team has many players on it.
sponsor (business_name, first_name, last_name, business_name, address, city, state, zip, phone)
· Every team has a sponsor although it could be a business or individual. For simplicity, I’m sticking with business. As mentioned above, a sponsor has a one to one or many relationships with a team.
players (players_id, first_name, last_name, age, rating, address, city, state, zip, phone, batting_avg, player_year_played, sponsor_first_name, sponsor_last_name)
· In softball, you need a minimal of 9 players which make up the team. Besides the necessary demographic information listed above. Once the players are rated, depending on the number they are split into divisions A thru D. The relationship between players and team is a one to many. As stated above, many players can belong to one team.
team_players (team_id, players_id, coach_first_name, coach_last_name, stats)
· Because there is a risk that a player may play for different teams in one year, I would probably have repeating data. So I’ve created the table above.
References: