SQL Integrity Constraints Questions and Answers
Integrity Constraints MCQs : This section focuses on the "Integrity Constraints" of the SQL. These Multiple Choice Questions (mcq) should be practiced to improve the SQL skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. To include integrity constraint in an existing relation use :
A. Modify table
B. Drop table
C. Alter table
D. Create table
View Answer
Ans : C
Explanation: SYNTAX : alter table table-name add constraint, where constraint can be any constraint on the relation.
2. Which of the following is not an integrity constraint?
A. Not null
B. Positive
C. Unique
D. Check predicate
View Answer
Ans : B
Explanation: Positive is a value and not a constraint.
3. Foreign key is the one in which the ________ of one relation is referenced in another relation.
A. Foreign key
B. Primary key
C. References
D. Check constraint
View Answer
Ans : B
Explanation: The foreign-key declaration specifies that for each course tuple, the department name specified in the tuple must exist in the department relation.
4. Domain constraints, functional dependency and referential integrity are special forms of _________
A. Foreign key
B. Primary key
C. Assertion
D. Referential constraint
View Answer
Ans : C
Explanation: An assertion is a predicate expressing a condition we wish the database to always satisfy.
5. Which of the following is the right syntax for the assertion?
A. CREATE ASSERTION [ assertion_name ]
CHECK ( [ condition ] );
B. CREATE ASSERTION CHECK ( [ condition ] );
C. CREATE ASSERTION [ assertion_name ];
D. All of the mentioned
View Answer
Ans : A
Explanation: No Explanation
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. When entering an order quantity, the user must input a number and not some text
View Answer
Ans : C
Explanation: The information can be referred to and obtained.
7. The Entity Customer has three candidate keys: a) CustId b) Email and c) ContactNo. Suggest the best primary key for this entity.
A. CustId
B. Email
C. ContactNo
D. CustId and ContactNo
View Answer
Ans : A
Explanation: CustId can be used as primary key.
8. Data integrity control __________.
A. is used to set upper and lower limits on numeric data
B. requires the use of passwords to prohibit unauthorized access to the file
C. has the data dictionary to keep the data and time of last access, last back-up, and most recent modifications for all files
D. none of these
View Answer
Ans : B
Explanation: Data integrity control requires the use of passwords to prohibit unauthorized access to the file
9. If the explicit value of attributes is not provided in SQL then the value included in new tuple in such situation is called
A. sampled statement
B. decimal value
C. notation statement
D. default value
View Answer
Ans : D
Explanation: No Explanation
10. Constraints that are applied on individual tuples and are verified whenever any tuple is modified or new tuple is inserted are called
A. language based constraints
B. tuple based constraints
C. scale based constraints
D. precision based constraints
View Answer
Ans : B
Explanation: No Explanation
Also check :
Discussion