Room number is unique. Each room consists of
approximately 20 cabins and each cabin number is unique with respect to room
number. The same cabin number may be used in different rooms. Each room has unique
phone number.

Which of the following is correct?

a) Room_no is a candidate key

b) Phone is a candidate key

c) (Cabin_no, Phone) and (Cabin_no, Room_no) are the candidate
keys.

d) (Room_no, Phone) and (Room_no, Cabin_no) are the
candidate keys.

Answer:

c) (Cabin_no,
Phone) and (Cabin_no, Room_no) are the candidate keys.

Room_no is unique and each room has 20 cabins hence,
retrieving data with Room_no as key will end up in at least 20 records. The same
is applicable for Phone.

Attributes A, B, and C are all unique valued attributes.
Which of the following is TRUE for R?

a) A is a candidate key for R

b) B is a candidate key for R

c) (A, C)
is a super key for R

d) all of the above

Answer:

d) all of the above

As all attributes are unique valued attributes, each
one of them is a candidate key on its own. Also, the combination of candidate
keys cannot form another candidate key but a super key.

5. Which of the following is usually chosen as a
primary key for a relation.

a) A candidate key that is composite

b) A super key

c) A candidate key that is minimal

d) All of the above

Answer:

c) A candidate key that
is minimal

A candidate key that is composite can also be chosen as
primary key. But in practice people usually prefers a minimal candidate key,
that is, a candidate key that has minimal number of attributes. For example, if
in a relation R(A, B, C), A is a candidate key and (B,C) is another candidate
key we prefer A as the primary key though (B, C) can also act as a primary key.