Free CompTIA DA0-002 Actual Exam Questions - Question 10 Discussion

Question No. 10

[Data Analysis]

The following SQL code returns an error in the program console: SELECT firstName, lastName, SUM(income) FROM companyRoster SORT BY lastName, income Which of the following changes allows this SQL code to run?

Select one option, then reveal solution.
US
AM
Adeel M.
2026-02-20

B imo, SUM needs GROUP BY when selecting other columns.

0
CG
Carlos G.
2026-02-09

Guessing B because without GROUP BY, you can’t use SUM with other columns like firstName and lastName. Fixing just SORT BY to ORDER BY won’t solve the aggregation error.

0
CG
Carlos G.
2026-02-02

B/C? B fixes the missing GROUP BY which is required with SUM, and C fixes the syntax typo from SORT BY to ORDER BY. Without both, it won't run properly. So either fix alone helps but in different ways.

0
LP
Liam P.
2026-01-26

B/C? The main issue is missing GROUP BY with SUM, so B definitely helps. But fixing SORT BY to ORDER BY, as in C, also solves the syntax error, though it lacks grouping. Both address different parts of the problem.

0
KN
Karan N.
2026-01-15

This one’s tricky because it has both aggregation and sorting issues. I think B makes sense since you need GROUP BY when using SUM with other columns. So, going with B.

0