What is the purpose of the SQL 'CONSTRAINT' keyword? MCQ with Answer and Explanation

What is the purpose of the SQL 'CONSTRAINT' keyword?
A. To define rules for data integrity
B. To create views
C. To join tables
D. To create indexes
Answer: Option A
Solution (By JKSSB Mock Tests)
Constraints are used to enforce rules on data, such as NOT NULL, UNIQUE, PRIMARY KEY, FOREIGN KEY, and CHECK.

Discuss this Question (0)

No comments yet. Be the first to start the discussion!

Practice More Database Management System (DBMS) Questions

Question #1
What is the difference between a database and a database management system?
A. They are the same
B. DBMS is the data; database is the software
C. A database is the data; DBMS is the software that manages it
D. Database is a file; DBMS is a table

Correct Answer: Option C


Explanation:
A database is a collection of structured data, while a DBMS is the software used to interact with and manage that data.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which operator is used to combine the distinct result sets of two or more SELECT queries into a single output, automatically filtering out duplicate rows?
A. UNION
B. INTERSECT
C. EXCEPT
D. UNION ALL

Correct Answer: Option A


Explanation:
The UNION operator merges the result sets of two queries, removing any duplicate records. UNION ALL performs a similar merge but retains duplicates.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which of the following is a type of lock in a database?
A. Both A and B
B. Shared lock
C. None
D. Exclusive lock

Correct Answer: Option A


Explanation:
Shared locks allow multiple transactions to read a resource, while exclusive locks allow only one transaction to write.

This question belongs to: Computer Database Management System (DBMS)