Which constraint ensures that every value in a specific column is unique across all rows in that table, but still permits a NULL value? MCQ with Answer and Explanation

Which constraint ensures that every value in a specific column is unique across all rows in that table, but still permits a NULL value?
A. FOREIGN KEY
B. UNIQUE
C. CHECK
D. PRIMARY KEY
Answer: Option B
Solution (By JKExamLibrary)
The UNIQUE constraint prevents duplicate entries in a column. Unlike a Primary Key, a UNIQUE constraint typically allows one or more rows to store NULL values depending on the database engine.

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

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1 Report Error
In SQL, what does the 'IS NULL' operator check?
A. Whether a value equals NULL
B. Whether a value is missing (null)
C. Whether a value is zero
D. Whether a value is empty string

Correct Answer: Option B


Explanation:
IS NULL is used to test for NULL values, because NULL is not equal to anything.

This question belongs to: Computer Database Management System (DBMS)
Question #2 Report Error
What is a domain in the context of the relational model?
A. A primary key
B. A foreign key
C. A table name
D. A set of allowed values for an attribute

Correct Answer: Option D


Explanation:
A domain defines the set of permissible values that an attribute can take, ensuring data consistency.

This question belongs to: Computer Database Management System (DBMS)
Question #3 Report Error
In SQL, how do you check if a value is NOT NULL?
A. IS NULL
B. != NULL
C. IS NOT NULL
D. NOT NULL

Correct Answer: Option C


Explanation:
IS NOT NULL is the correct operator to test for non-NULL values.

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