61.0k views
5 votes
Suppose you are given the following requirements for a simple database for the Ghana Premier League (GPL):

The GPL has many teams
Each team has a name, a city, a coach, a captain, and a set of players
Each player belongs to only one team
Each player has a name, a position (such as left wing or goalie), a skill level, and a set of injury records
A team captain is also a player
A game is played between two teams (referred to as host_team and guest_team) and has a date (such as Jan 11th, 2023) and a score (such as host_team (4) to guest_team (2)).
Construct a clean and concise ER diagram for the GPL database.

User Oxygenan
by
7.7k points

1 Answer

1 vote

Answer:

Here's a simplified ER (Entity-Relationship) diagram for the Ghana Premier League (GPL) database based on the provided requirements:

Entities:

Team (Attributes: TeamID (Primary Key), Name, City, Coach, CaptainID)

Player (Attributes: PlayerID (Primary Key), Name, Position, Skill Level, TeamID (Foreign Key))

Game (Attributes: GameID (Primary Key), Date, Score, HostTeamID (Foreign Key), GuestTeamID (Foreign Key))

Relationships:

Each Team has Many Players (One-to-Many relationship between Team and Player, TeamID as Foreign Key in Player)

Each Game is Played by Two Teams (One-to-Many relationship between Game and Team for both HostTeam and GuestTeam, with HostTeamID and GuestTeamID as Foreign Keys in Game)

Each Team has One Captain (One-to-One relationship between Team and Player, CaptainID in Team references PlayerID in Player)

Attributes:

TeamID (Primary Key) in Team

PlayerID (Primary Key) in Player

GameID (Primary Key) in Game

This ER diagram represents the relationships between teams, players, and games in the GPL database, satisfying the given requirements. It's a simplified representation, and you can further expand it to include additional attributes or details as needed.

Step-by-step explanation:

User Jemerick
by
7.2k points