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

What is the purpose of the SQL DISTINCT keyword?
A. To sort the result set
B. To return only unique rows in the result set
C. To filter rows based on a condition
D. To group the results
Answer: Option B
Solution (By JKSSB Mock Tests)
DISTINCT removes duplicate rows from the query result.

Discuss this Question (0)

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

Practice More Database Management System (DBMS) Questions

Question #1
Which of the following is a property of a database that ensures transactions are isolated from each other?
A. Consistency
B. Durability
C. Atomicity
D. Isolation

Correct Answer: Option D


Explanation:
Isolation ensures that concurrent execution of transactions results in a state that is equivalent to some serial execution.

This question belongs to: Computer Database Management System (DBMS)
Question #2
What is the purpose of the SQL 'CHECK' constraint?
A. To set a default value
B. To define relationships
C. To validate data based on a condition
D. To enforce uniqueness

Correct Answer: Option C


Explanation:
CHECK constraint ensures that values in a column meet a specified condition, such as age > 0.

This question belongs to: Computer Database Management System (DBMS)
Question #3
The range of all permissible and valid values that an attribute can hold is formally defined as its what?
A. Schema
B. Tuple
C. Relation
D. Domain

Correct Answer: Option D


Explanation:
A Domain is the pool of legal, atomic values from which an attribute can take its value.

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