Which of the following is a valid constraint in SQL? MCQ with Answer and Explanation

Which of the following is a valid constraint in SQL?
A. PRIMARY KEY
B. FOREIGN KEY
C. All of the above
D. CHECK
Answer: Option C
Solution (By JKSSB Mock Tests)
CHECK, PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL are all constraints in SQL.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which type of lock prevents other concurrent transactions from obtaining any form of lock on the same row, securing exclusive read and write access?
A. Implicit Lock
B. Static Lock
C. Shared Lock
D. Exclusive Lock

Correct Answer: Option D


Explanation:
An Exclusive Lock (X-lock) blocks all other locks, ensuring that only the transaction holding the lock can modify or read the protected resource.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is a relation in relational database terms?
A. A table
B. A key
C. A column
D. A row

Correct Answer: Option A


Explanation:
In the relational model, a relation is a table consisting of rows and columns.

This question belongs to: Computer Database Management System (DBMS)
Question #3
What is the purpose of the SQL 'IN' operator?
A. To check if a value matches any value in a list
B. To join tables
C. To check if a value is null
D. To check if a value is between two values

Correct Answer: Option A


Explanation:
IN is used to test membership in a set of values.

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