ORDER_ITEMSテーブルの説明を調べます。 この不完全なクエリを調べてください。 SELECTDISTINCT数量* unit_price total_paid FROM order_items ORDER BY <clause>; クエリが正常に完了するように<clause>を置き換えることができるのはどれですか?
正解:B,E
In a SELECT statement with DISTINCT, the ORDER BY clause can only order by expressions that are part of the SELECT list. A . quantity alone is not sufficient to replace <clause> as it is not included in the SELECT list after DISTINCT. B . This option can successfully replace <clause> because both quantity and unit_price are used in the SELECT expression, and thus their individual values are valid for the ORDER BY clause. C . total_paid is an alias for the expression quantity * unit_price, but it cannot be used in the ORDER BY clause because Oracle does not allow aliases of expressions in DISTINCT queries to be used in ORDER BY. D . product_id is not included in the SELECT list after DISTINCT and thus cannot be used in ORDER BY. E . The expression quantity * unit_price is exactly what is selected, so it can replace <clause> and the query will complete successfully. Reference: Oracle Database SQL Language Reference, 12c Release 1 (12.1): "ORDER BY Clause"