Database Questions and Answers – Constraints

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

1. _____________ express the number of entities to which another entity can be associated via a relationship set.
a) Mapping Cardinality
b) Relational Cardinality
c) Participation Constraints
d) None of the mentioned
View Answer

Answer: a
Explanation: Mapping cardinality is also called as cardinality ratio.

2. An entity in A is associated with at most one entity in B, and an entity in B is associated with at most one entity in A.This is called as
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one
View Answer

Answer: b
Explanation: Here one entity in one set is related to one one entity in other set.

3. An entity in A is associated with at most one entity in B. An entity in B, however, can be associated with any number (zero or more) of entities in A.
a) One-to-many
b) One-to-one
c) Many-to-many
d) Many-to-one
View Answer

Answer: d
Explanation: Here more than one entity in one set is related to one one entity in other set.
advertisement
advertisement

4. Data integrity constraints are used to:
a) Control who is allowed access to the data
b) Ensure that duplicate records are not entered into the table
c) Improve the quality of data entered for a specific property
d) Prevent users from changing the values stored in the table
View Answer

Answer: c
Explanation: The data entered will be in a particular cell (i.e., table column).

5. Establishing limits on allowable property values, and specifying a set of acceptable, predefined options that can be assigned to a property are examples of:
a) Attributes
b) Data integrity constraints
c) Method constraints
d) Referential integrity constraints
View Answer

Answer: b
Explanation: Only particular value satisfying the constraints are entered in the column.

6. Which of the following can be addressed by enforcing a referential integrity constraint?
a) All phone numbers must include the area code
b) Certain fields are required (such as the email address, or phone number) before the record is accepted
c) Information on the customer must be known before anything can be sold to that customer
d) Then entering an order quantity, the user must input a number and not some text (i.e., 12 rather than ‘a dozen’)
View Answer

Answer: c
Explanation: None.

7. ______ is a special type of integrity constraint that relates two relations & maintains consistency across the relations.
a) Entity Integrity Constraints
b) Referential Integrity Constraints
c) Domain Integrity Constraints
d) Domain Constraints
View Answer

Answer: b
Explanation: None.
advertisement

8. Which one of the following uniquely identifies the elements in the relation?
a) Secondary Key
b) Primary key
c) Foreign key
d) Composite key
View Answer

Answer: b
Explanation: Primary key checks for not null and uniqueness constraint.

9. Drop Table cannot be used to drop a table referenced by a _________ constraint.
a) Local Key
b) Primary Key
c) Composite Key
d) Foreign Key
View Answer

Answer: d
Explanation: Foreign key is used when primary key of one relation is used in another relation.
advertisement

10. ____________ is preferred method for enforcing data integrity
a) Constraints
b) Stored Procedure
c) Triggers
d) Cursors
View Answer

Answer: a
Explanation: Constraints are specified to restrict entries in the relation.

Sanfoundry Global Education & Learning Series – Database Management System.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

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.