Assume you have the following table:
T ( A, B, C, D, E )
Part 1:
The attributes C, D and E are numeric types that you want to add them together for each combination of A and B. What's wrong with the query below:
Select A, B, C + D + E as Total from T group by A, B where Total > 10;
Briefly describe what's wrong with the query and rewrite so that it's correct.
Part 2:
Is there a way to further simplify your query from part 1? If so rewrite it to be as simple as possible.