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 create indexes
B. To define rules for data integrity
C. To join tables
D. To create views
Answer: Option B
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
Which SQL command is used to create a new table?
A. SELECT
B. INSERT
C. UPDATE
D. CREATE TABLE

Correct Answer: Option D


Explanation:
The CREATE TABLE command in DDL is used to define a new table structure in SQL.

This question belongs to: Computer Database Management System (DBMS)
Question #2
Which database model improves upon the hierarchical model by allowing a child record to have multiple parent records, creating a graph-like structure?
A. Relational Model
B. Star Schema
C. Flat File Model
D. Network Model

Correct Answer: Option D


Explanation:
The Network Model represents data as graphs where a record (node) can have multiple parent and child records, solving the strict single-parent limitation of hierarchical systems.

This question belongs to: Computer Database Management System (DBMS)
Question #3
Which SQL component is used to specify a fallback default value for a column when no value is provided during an insert operation?
A. DEFAULT
B. NOT NULL
C. CHECK
D. UNIQUE

Correct Answer: Option A


Explanation:
The DEFAULT constraint assigns a predefined default value to a column when an INSERT statement does not explicitly provide a value for that column.

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