Monday, July 23, 2018

Relational model in DBMS Multiple choice questions with answers

Relational model in DBMS Multiple choice questions with answers

Multiple Choice Questions 30:

1. Which one of the following is correct?
a) Each candidate key is a primary key
b) Each primary key is a foreign key
c) Each foreign key must refer a primary key of a relation.
d) Each foreign key refers a candidate key in a relation.
Answer:
d) Each foreign key refers a candidate key in a relation.
Foreign key attribute refers attribute that contains unique values. It need not be the primary key always.

2. The value of an attribute in a table may be NULL because,
a) the value is not known
b) the value does not exist
c) the value is not applicable
d) all of the above
Answer:
d) all of the above.
NULL refers to all the options a, b, and c.

3. Consider a relation office with the following schema;

Office(Cabin_no, Room_no, Phone)

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.
Cabin_no is unique for each room[or phone]. So, (cabin_no, phone) or (cabin_no, room_no) can uniquely identify records.

4. Consider the following schema of relation R;

R (A, B, C)

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.

***********



Go to Advanced DBMS Concepts page




multiple choice questions in relational model of DBMS
MCQs in relational model
MCQ about super key, candidate key and primary key
relational data model in database
solved quiz questions with answer in relational model

No comments:

Post a Comment

Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents