Oracle
1Z0-047 · Question #63
View the Exhibit and examine the description of the ORDER_ITEMS table. The following SQL statement was written to retrieve the rows for the PRODUCT_ID that has a UNIT_PRICE of more than 1,000 and…
The correct answer is B. The statement would not execute because the aggregate function is used in the WHERE clause. See the full explanation below for the reasoning.
Question
View the Exhibit and examine the description of the ORDER_ITEMS table. The following SQL statement was written to retrieve the rows for the PRODUCT_ID that has a UNIT_PRICE of more than 1,000 and has been ordered more than five times:
SELECT product_id, COUNT(order_id) total, unit_price FROM order_items WHERE unit_price>1000 AND COUNT(order_id)>5 GROUP BY product_id, unit_price; Which statement is true regarding this SQL statement?
Exhibit
Options
- AThe statement would execute and give you the desired result.
- BThe statement would not execute because the aggregate function is used in the WHERE clause.
- CThe statement would not execute because the WHERE clause should have the OR logical operator
- DThe statement would not execute because in the SELECT clause, the UNIT_PRICE column is
How the community answered
(34 responses)- A6% (2)
- B79% (27)
- C3% (1)
- D12% (4)
Community Discussion
No community discussion yet for this question.
