Suppose you are given the following requirements for a simple database for the National…
- User
Suppose you are given the following requirements for a simple database for the National Hockey League (NHL): a) the NHL has many teams, b) each team has a name, a city, a coach, a captain, and a set of players, c) each player belongs to only one team, d) each player has a name, a position (such as left wing or goalie), a skill level, and a set of injury records, e) a team captain is also a player, f) a game is played between two teams (referred to as host_team and guest_team) and has a date (such as May 11th, 1999) and a score (such as 4 to 2). Construct a clean and concise ER diagram for the NHL database using the Chen notation as in your textbook. List your assumptions and clearly indicate the cardinality mappings as well as any role indicators in your ER diagram.
- Assistant
Assumptions:
- Each team has only one coach and one captain.
- Each game has only one host team and one guest team.
- Each player can have multiple injury records.
ER Diagram:
lua+--------+ +--------+ | Player | | Team | +--------+ +--------+ | | | has 1 1 | has | | +---------+-------+ | | | | +------+-----+ +-------+------+ | | Captain/Player | | Coach | +------+-----+ +-------------+ | has | | +---+-----+ | Injury | +---------+ - User
Construct an E-R diagram for a car-insurance company whose customers own one or more cars each. Each car has associated with it zero to any number of recorded accidents
- Assistant
ER Diagram:
sql+-----------+ +---------+ +--------+ | Customer| | Car | | Accident | +-----------+ +---------+ +--------+ | customer_id| | car_id| |accident_id| | name | | model | | date | | address | | make | |location | | email | | year | | cost | +-----------+ +---------+ +--------+ | | | | owns | has | is involved in | | | +-----+-----+ +-----+-----+ +-------+-------+ | Policy | | Coverage | | Accident-Claim | +-----+-----+ +-----+-----+ +---------------+ | policy_id| | coverage| | claim_id | | start | | type | | date | | end | | amount | | description | +----------+ +---------+ +---------------+ - User
Construct an E-R diagram for a hospital with a set of patients and a set of medical doctors. Associate with each patient a log of the various tests and examinations conducted.
- Assistant
ER Diagram:
lua+-----------+ +---------------+ +------------+ | Patient | | Test-Examination| | Medical | +-----------+ +---------------+ | Doctor | | patient_id| | test_id | | doctor_id | | name | | patient_id | | name | | address | | doctor_id | | specialty | | email | | test_date | +------------+ +-----------+ | test_results | | +---------------+ | has | +-----+-----+ | Log | +----------+ | log_id | | patient_id| | test_id | +----------+ - User
A university registrar’s office maintains data about the following entities: (a) courses, including number, title, credits, syllabus, and prerequisites; (b) course offerings, including course number, year, semester, section number, instructor(s), timings, and classroom; (c) students, including student-id, name, and program; and (d) instructors, including identification number, name, department, and title. Further, the enrollment of students in courses and grades awarded to students in each course they are enrolled for must be appropriately modeled. Construct an E-R diagram for the registrar’s office. Document all assumptions that you make about the mapping constraints.
- Assistant