Difficulty: Easy
Correct Answer: Incorrect
Explanation:
Introduction / Context:
DISTINCT removes duplicate rows from a SELECT result, while ALL (the default) retains all rows. Understanding where and how often DISTINCT/ALL can appear prevents syntax errors and unintended results. This question tests whether you can apply DISTINCT multiple times in one SELECT clause.
Given Data / Assumptions:
Concept / Approach:
Within a single SELECT query block, DISTINCT (or ALL) can be specified at most once and it applies to the whole projection list taken together. You cannot use DISTINCT per column or repeat it multiple times. You may, however, use DISTINCT in separate query blocks (for example, subqueries) or specify DISTINCT/ALL for set operators such as UNION DISTINCT or UNION ALL independently of the inner SELECT’s DISTINCT.
Step-by-Step Solution:
Verification / Alternative check:
Vendor references show DISTINCT as a single keyword per query block; repeating it triggers a parse error.
Why Other Options Are Wrong:
Common Pitfalls:
Misusing DISTINCT to mask joins that duplicate rows; placing DISTINCT where GROUP BY is more appropriate.
Final Answer:
Incorrect
Discussion & Comments