View the Exhibit and examine the structure of the PRODUCTS table. (Choose the best answer.)
You must display the category with the maximum number of items.
You issue this query:
SQL > SELECT COUNT(*), prod_category_id
FROM products
GROUP BY prod_category_id HAVING COUNT(*) = (SELECT MAX(COUNT(*)) FROM porducts);
What is the result?
A. It generates an error because = is not valid and should be replaced by the IN operator.
B. It executes successfully but does not give the output.
C. It executes successfully and gives the output.
D. It generate an error because the subquery does not have a GROUP BY clause.
Answer: D
Explanation/Reference:
做个lab验证,参考下图