Database Questions and Answers – Keys

This set of Database Multiple Choice Questions & Answers (MCQs) focuses on “Keys”.

1. Which one of the following is a set of one or more attributes taken collectively to uniquely identify a record?
a) Candidate key
b) Sub key
c) Super key
d) Foreign key
View Answer

Answer: c
Explanation: Super key is the superset of all the keys in a relation.

2. Consider attributes ID, CITY and NAME. Which one of this can be considered as a super key?
a) NAME
b) ID
c) CITY
d) CITY, ID
View Answer

Answer: b
Explanation: Here the id is the only attribute which can be taken as a key. Other attributes are not uniquely identified.

3. The subset of a super key is a candidate key under what condition?
a) No proper subset is a super key
b) All subsets are super keys
c) Subset is a super key
d) Each subset is a super key
View Answer

Answer: a
Explanation: The subset of a set cannot be the same set. Candidate key is a set from a super key which cannot be the whole of the super set.
advertisement
advertisement

4. A _____ is a property of the entire relation, rather than of the individual tuples in which each tuple is unique.
a) Rows
b) Key
c) Attribute
d) Fields
View Answer

Answer: b
Explanation: Key is the constraint which specifies uniqueness.

5. Which one of the following attribute can be taken as a primary key?
a) Name
b) Street
c) Id
d) Department
View Answer

Answer: c
Explanation: The attributes name, street and department can repeat for some tuples. But the id attribute has to be unique. So it forms a primary key.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. Which one of the following cannot be taken as a primary key?
a) Id
b) Register number
c) Dept_id
d) Street
View Answer

Answer: d
Explanation: Street is the only attribute which can occur more than once.

7. An attribute in a relation is a foreign key if the _______ key from one relation is used as an attribute in that relation.
a) Candidate
b) Primary
c) Super
d) Sub
View Answer

Answer: b
Explanation: The primary key has to be referred in the other relation to form a foreign key in that relation.
advertisement

8. The relation with the attribute which is the primary key is referenced in another relation. The relation which has the attribute as a primary key is called ______________
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
View Answer

Answer: c
Explanation: The referenced relation is the table that contains the primary key being referenced.

9. The ______ is the one in which the primary key of one relation is used as a normal attribute in another relation.
a) Referential relation
b) Referencing relation
c) Referenced relation
d) Referred relation
View Answer

Answer: b
Explanation: The referencing relation is the table that contains the foreign key.
advertisement

10. A _________ integrity constraint requires that the values appearing in specified attributes of any tuple in the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.
a) Referential
b) Referencing
c) Specific
d) Primary
View Answer

Answer: a
Explanation: A relation, say r1, may include among its attributes the primary key of another relation, say r2. This attribute is called a foreign key from r1, referencing r2. The relation r1 is also called the referencing relation of the foreign key dependency, and r2 is called the referenced relation of the foreign key.

Sanfoundry Global Education & Learning Series – Database Management System.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.