Oracle
1Z0-047 · Question #27
View the Exhibit and examine PRODUCTS and ORDER_ITEMS tables. You executed the following query to display PRODUCT_NAME and the number of times the product has been ordered: SELECT p.product_name…
The correct answer is A. The statement would execute successfully to produce the required output. See the full explanation below for the reasoning.
Question
View the Exhibit and examine PRODUCTS and ORDER_ITEMS tables. You executed the following query to display PRODUCT_NAME and the number of times the product has been ordered:
SELECT p.product_name, i.item_cnt FROM (SELECT product_id, COUNT (*) item_cnt FROM order_items GROUP BY product_id) i RIGHT OUTER JOIN products p ON i.product_id = p.product_id; What would happen when the above statement is executed?
Exhibit
Options
- AThe statement would execute successfully to produce the required output.
- BThe statement would not execute because inline views and outer joins cannot be used together.
- CThe statement would not execute because the ITEM_CNT alias cannot be displayed in the outer query.
- DThe statement would not execute because the GROUP BY clause cannot be used in the inline view.
How the community answered
(20 responses)- A85% (17)
- B10% (2)
- D5% (1)
Community Discussion
No community discussion yet for this question.
