Submit your responses as a PDF file via Canvas by the due date.
1. Consider the following scenario: A company has a number of customers who have
addresses and phone numbers, and we assume that while there may be multiple
customers with the same address, no two customers with the same name have the
same address or the same phone number. Each customer has a customer id, which is
unique to that customer. Suppose that this information is stored as a relational database
relation or table. Answer the following:
a. What is the schema for this relation (the attributes or columns and their domains or
b. What are possible superkeys for this relation?
c. Which of the superkeys identified above are the candidate keys for the relation?
d. What is the best choice from the candidate keys for the primary key of the relation?
2. Consider the previous scenario. Suppose now that the company wants to also build
relations that describe its inventory and sales transactions. For the inventory, the store
keeps track of the following:
The product manufacturer name
The product model number
The number in stock
The wholesale price
The retail price
A manufacturer has many products, each of which has a product number that is unique
for that manufacturer. However, two manufacturers could have the same product
numbers for some of their products.
For the sales transactions, the company tracks the following
The customer id of the customer making the sale
The date of the sale
The product purchased model number
The product purchased manufacturer name
The price paid including tax
Assume that a customer makes only one order on any given day.
Develop the schemas for each of the above relations, including primary keys and foreign
keys, using only attributes representing the information described above. Note that for
the sales transaction relation, you must develop foreign keys that refer to the customer
table and the inventory table.
Page 1 of 4
3. Consider the following set of tables describing students and school clubs:
SID Name Gender Status GPA
103 Mary F
a. Assuming that SID and CID are unique identifiers, what are likely primary keys for
the Student and Clubs tables?
b. What is the primary key for the ClubMemberships table?
c. What are foreign keys necessary for this set of tables in order to ensure that only
registered students can be in clubs and students can only join registered clubs?
4. Can you add the following tuple to the ClubMemberships table based on your foreign
Why or why not?
5. Can you add the following tuple to the ClubMemberships table based on your foreign
Why or why not?
6. Consider the following scenario from your textbook on page 118 dealing with a chain of
hotels that need to manage the bookings of their guests into rooms at specific hotels in
the chain. The hotel chain maintains four tables in order to manage this information:
Hotel(hotelNo, hotelName, city)
Room(roomNo, hotelNo, type, price)
Booking(hotelNo, guestNo, dateFrom, dateTo, roomNo)
Guest(guestNo, guestName, guestAddress, guestPhoneNo, guestEmail)
The underlined attribute(s) of each relation form the primary key of the relation.
a. Identify foreign key relations in the tables that will allow the appropriate referential
integrity rules to be applied. For each foreign key relation, specify the referring table, the
primary table, and the attributes that form the foreign key in the referring table. For
example, a guest should not be booked into a non-existing room at a hotel. A guest
should not be booked into a room unless there is information about the guest.
Page 2 of 4
For the remaining questions, use the following set of relational database tables to the
results for the relational algebra expressions.
F G H
j y i
A B C D
C D E F
1 e 4
2 s 11 t
t f s
2 g 9
4 e 8
x b o
9 h 15 k
d a w
3 x 13 f
Purchase answer to see full