Oracle Database Administration I — Question 6

Table ORDER_ITEMS contains columns ORDER_ID, UNIT_PRICE and QUANTITY, of data type NUMBER.
Examine these SQL statements:
Statement 1:
SELECT MAX(unit_price * quantity) `Maximum Order`
FROM order_items;
Statement 2:
SELECT MAX(unit_price * quantity) `Maximum Order`

FROM order_items -
GROUP BY order_id;
Which two statements are true?

Answer options

Correct answer: A, E

Explanation

Statement 1 computes the maximum value across the entire dataset, resulting in only one row. In contrast, Statement 2 groups the results by ORDER_ID, which can lead to multiple maximum values, hence multiple rows of output. Therefore, options A and E are correct.