Assignment 4

.pdf

School

Albany State University *

*We aren’t endorsed by this school

Course

2201

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

2

Uploaded by KidOkapiMaster979

Report
For this assignment, you need to complete questions A - H on p. 136 of Chapter 5: A. Identify the candidate keys of each relation. a. TEAM: Team Number, Team Name COACH: Team Number, Coach Name (a two-field candidate key) WORK EXPERIENCE: Team Number, Coach Name, Experience Type (a three-field candidate key) BATS: Team Number, Serial Number (a two-field candidate key) PLAYER: Player Number AFFILIATION: Player Number, Team Number (a two-field candidate key) B. Identify the primary key and any alternate keys of each relation. a. TEAM: Team Number is primary; Team Name is alternate COACH: Team Number, Coach Name is primary WORK EXPERIENCE: Team Number, Coach Name, Work Experience is primary BATS: Team Number, Serial Number is primary PLAYER: Player Number is primary AFFILIATION: Player Number, Team Number is primary C. How many foreign keys does each relation have? a. TEAM: 0 COACH: 1 WORK EXPERIENCE: 2 BATS: 1 PLAYER: 0 AFFILIATION: 2 D. Identify the foreign keys of each relation. a. COACH: Team Number WORK EXPERIENCE: Team Number (because it’s the primary key of the TEAM relation) and Team Number, Coach Name (because it’s the primary key of the COACH relation) BATS: Team Number AFFILIATION: Player Number and Team Number E. Indicate any instances in which a foreign key serves as part of the primary key of the relation in which it is a foreign key. Why does each of those relations require a multi-attribute primary key? a. In the COACH relation, Team Number is a foreign key and serves as part of the primary key because the problem states that coach names are only unique within a team.In the WORK EXPERIENCE relation Team Number, Coach Name is a foreign key and serves as part of the primary key because Experience Type is only unique within a coach F. Identify the relations that support many-to-many relationships, the primary keys of those relations, and any intersection data.
G. Assume that we add the following STADIUM relation to the Super Baseball League relational database. Each team has one home stadium, which is what is represented in this relation. Assume a stadium can serve as the home stadium for only one team. The Stadium Name is unique across the league. What kind of binary relationship exists between the STADIUM relation and the TEAM relation? Could the data from the two relations be combined into one without introducing data redundancy? If so, how? H. Using the informal relational command language described in this chapter, write commands to: i. Retrieve the record for team number 12. ii. Retrieve the record for coach Adams on team number 12. iii. List the player number and age of every player. iv. List the work experience of every coach. v. List the work experience of every coach on team number 25. vi. Find the age of player number 42459. vii. List the serial numbers and manufacturers of all of the Vultures’ (the name of a team) bats. viii. Find the number of years of college coaching experience coach Taylor of the Vultures has.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help