nerdexam
Oracle

1Z0-061 · Question #307

View the Exhibit and examine the structure of the PRODUCTS tables. You want to generate a report that displays the average list price of product categories where the average list price is less than…

The correct answer is A. SELECT prod_category, avg(prod_list_price). Using the ANY Operator in Multiple-Row Subqueries The ANY operator (and its synonym, the SOME operator) compares a value to each value returned by a subquery. <ANY means less than the maximum. >ANY means more than the minimum. =ANY is equivalent to IN Using the ALL Operator in…

Reporting Aggregated Data using the Group Functions

Question

View the Exhibit and examine the structure of the PRODUCTS tables. You want to generate a report that displays the average list price of product categories where the average list price is less than half the maximum in each category. Which query would give the correct output?

Options

  • ASELECT prod_category, avg(prod_list_price)
  • BSELECT prod_category, avg(prod_list_price)
  • CSELECT prod_category, avg(prod_list_price)
  • DSELECT prod_category, avg(prod_list_price)

How the community answered

(24 responses)
  • A
    71% (17)
  • B
    4% (1)
  • C
    8% (2)
  • D
    17% (4)

Explanation

Using the ANY Operator in Multiple-Row Subqueries The ANY operator (and its synonym, the SOME operator) compares a value to each value returned by a subquery. <ANY means less than the maximum. >ANY means more than the minimum. =ANY is equivalent to IN Using the ALL Operator in Multiple-Row Subqueries The ALL operator compares a value to every value returned by a subquery. >ALL means more than the maximum and <ALL means less than the minimum. The NOT operator can be used with IN, ANY, and ALL operators.

Topics

#AVG function#GROUP BY#HAVING clause#aggregate filtering

Community Discussion

No community discussion yet for this question.

Full 1Z0-061 Practice