QuestionQ22

VerifiedReporting Aggregated Data Using the Group Functions

Examine the structure of the MARKS table:

Exhibit:

Question Image

Which two statements execute successfully?

Choose two
Explanation

A WHERE clause can filter individual rows but cannot contain an aggregate such as AVG; aggregate-result filtering requires HAVING or a subquery. A query without GROUP BY cannot select both a nonaggregated column and an aggregate expression. Queries containing only aggregate expressions, with row-level predicates in WHERE, are valid; therefore the SUM expression in C and the SUM(DISTINCT NVL(...)) plus MAX expressions in D execute successfully.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!