フリー問題

Oracle Database SQL のフリー問題 11 / 20 問目

問題文

A developer writes WHERE salary > AVG(salary) in a query over one table and receives a group function is not allowed here error. Which rewrite expresses the same intent correctly?

選択肢

  1. Put the average in a subquery so that the comparison reads a single value that the inner query works out once for the whole statement.
  2. Put the average in the HAVING clause so that the comparison reads a single value that the same query computes for the whole table.
  3. Put the average in the ORDER BY clause so that the comparison reads the sorted position of each row rather than the value of the average.
  4. Put the average in the select list with an alias so that the comparison reads that alias in the same query as a single value.

解答・解説を確認するには

正解と解説の確認、回答の記録には無料登録が必要です。登録すると演習モードでフリー問題に回答し、正誤と解説をその場で確認できます。