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. 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 (i.e., table column)
D. Prevent users from changing the values stored in the table
View Answer
Ans : C
Explanation: No Explanation
7. 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.
8. The relationship between the two tables are created using __________
A. Candidate Key
B. Primary Key
C. Foreign Key
D. Check Constraint
View Answer
Ans : C
Explanation: The relationship between the two tables are created using Foreign Key
9. 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.
10. Which of the following statement(s) is/are FALSE about primary key?
A. There can be more than one primary key for a table
B. Columns with string data types cannot be made Primary Key because they are large
C. Both A and B
D. None of the above
View Answer
Ans : C
Explanation: Both A and B following statement(s) is/are FALSE about primary key
11. 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
12. Referential triggered action clause in Standard Query Language is attached to constraint called
A. primary key constraint
B. stamped key constraint
C. interval notation constraint
D. foreign key constraint
View Answer
Ans : D
Explanation: No Explanation
13. 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
14. If the referential integrity constraint is violated then the specific action clause attached by the database designers other than by default action is classified as
A. referential triggered action
B. foreign key triggered action
C. primary key triggered action
D. decimal triggered action
View Answer
Ans : A
Explanation: No Explanation
15. 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
16. Which of the following is not a 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.
17. SQL standard allows a clause initially deferred to be added to a
A. Uniqueness specification
B. Atomicity specification
C. Constraint specification
D. Isolation specification
View Answer
Ans : C
Explanation: SQL standard allows a clause initially deferred to be added to a Constraint specification.
18. When a referential-integrity constraint is violated, the normal procedure is to
A. Continue with flow
B. Accept the action
C. Reject the action
D. Store it for evaluation
View Answer
Ans : C
Explanation: When a referential-integrity constraint is violated, the normal procedure is to Reject the action.
19. The most easily tested constraints of a new data entered is into a database is called?
A. referential constraints
B. domain constraints
C. assertion
D. None of these
View Answer
Ans : B
Explanation: The most easily tested constraints of a new data entered is into a database is called domain constraints.
20. Constraints are the preferred method for enforcing data
A. data topple
B. data integrity
C. data inheritance
D. None of the above
View Answer
Ans : B
Explanation: Constraints are the preferred method for enforcing data integrity.
Also check :
Discussion