nerdexam
Oracle

1Z0-047 · Question #224

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

1Z0-047 question #224 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

(47 responses)
  • A
    74% (35)
  • B
    4% (2)
  • C
    15% (7)
  • D
    6% (3)

Community Discussion

No community discussion yet for this question.

Full 1Z0-047 Practice