# Databse ER Diagram question



## saknid (Apr 26, 2017)

So basically, I really dont have a very good understanding of DB and following question have been asked in some exam (previous year), can any one with DB knowledge help?

Create a complete Entity-Relationship (ER) diagram for a database that stores the following information
about a baseball league. You should model the Entities and their attributes, as well as the
Relationships and their constraints. Write both the minimum and maximum participation of entities in
a relationship as explained in class: for example, if a constraint states that a minimum of 2 and a
maximum of N entities can participate in the relationship, write 2:N (not just N).

 The database stores information about players, teams, and games. A player has a unique player
name. A team has a unique team name. A game has a unique game number. These are the only
entities in the database.

 A player plays for one team at any given time. The start date and end date for the player’s
assignment on the team is recorded. A team will consists of 9 or more players.

 The database keeps track of every time a player participates in a game. It also stores the player’s
performance rating (A,B,C,D,F).

 For each game, there will be one home team and one away team. The date, time, and field name
will be recorded for each game.

 For each game, the Inning Score for the home team and the away team will be stored. The Inning
Score consists of: the number of runs, hits, and errors. The Final Score of the game will be also be
stored for both the home team and the away team (runs, hits, and errors).


----------



## W1zzard (Apr 26, 2017)

Where is the issue specifically? I'm sure you can complete like 90% of it on a piece of paper in 5 minutes


----------



## saknid (Apr 26, 2017)

Ya I can create DB easily but I really dont have any idea about ER Diagrams :-D u knw google and learn db scripting thing.


----------



## W1zzard (Apr 26, 2017)

They really just represent your table structure. Read up on them, they are easy, especially if you know how to work with databases already


----------



## Boosnie (Jun 5, 2017)

An assignment based on a name as a unique ideintifier is an assignment from a shitty dbs class.
Refuse to partecipate.


----------



## Boosnie (Jun 5, 2017)

on a more serious side...

this basically is Player Team ER based on the first 2 points of your assignment.





you can see we have Players, Teams and a third table that connects the 2 entities.
The PlayersTeams have an unique key that prevents the same player playing for the same team on the same date(but this is a wrong way to do that, it's only for educational purpose. To be honest I do not even know if there is a simple method to strengthen a relashoship on time periods)

On the connections you have a 1:many relashonship in either case, where "1" is where the key is and "Many" is where the "infinity" sign is


----------

