Show the worked solutionWhen an aggregate such as COUNT(*) appears in the SELECT list, every other selected column must appear in GROUP BY. In (B), A is not grouped, so the query has no single value of A to show beside one total count. It is illegal.(A) A plain projection — legal.(C) and (D) Every non-aggregated column is in GROUP BY — legal.Answer: B
GATE DA practice: past exam problems by chapter, with worked solutions · gatedaprep.com