Consider a simplified relational schema for a Game Room (consisting of three rel
ID: 3753140 • Letter: C
Question
Consider a simplified relational schema for a Game Room (consisting of three relations):
- Shelf (shelfId, shelfName)
- Game (gameId, gameName, shelfId)
- Staff (staffId, staffName, shelfId)
The following conditions are satisfied:
- Every shelf has exactly one unique id and one unique name.
- Every board game has a unique id and one name, but different games may have the same name.
- Every staff has an id and a name, and no staffs in the store have the same id or name.
- A shelf can store many games, but each game is only placed on one shelf.
- A staff is responsible to one shelf, and one shelf is maintained by one or more staffs.
Question:
1.)What are the super keys for each of the relations: Shelf, Game, and Staff?
2.)What are the candidate keys for each of the relations: Shelf, Game, and Staff?
3.)What is the primary key for each of the relations: Shelf, Game, and Staff?
4.) What are the foreign keys for the relations: Shelf, Game, and Staff?
PLEASE ORGANIZE THE ANSWER, SO THE POST IS READABLE, THANKS!
Explanation / Answer
Super keys : The set of attributes which can uniquely identify a tuple in a relation is known as super Key.
Candidate Keys The minimal set of attribute which can uniquely identify a tuple in a relation is known as candidate keys.
Primary keys :
Foreign Keys: