Which of the following queries displays the sum of all employee salaries for those employees not making commission, for each job, including only those sums greater than 2500?

Options
- select job, sum(sal) from emp where sum(sal) > 2500 and comm is null;
- select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;
- select job, sum(sal) from emp where sum(sal) > 2500 and comm is null group by job;
- select job, sum(sal) from emp group by job having sum(sal) > 2500 and comm is not null;


CORRECT ANSWER : select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;

Discussion Board
Correct answer is: select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;

Correct answer is: select job, sum(sal) from emp where comm is null group by job having sum(sal) > 2500;
For aggregate functions (COUNT, MAX, MIN, SUM, AVG), GROUP BY clause is mandatory. Otherwise, you will get the error.

Prajakta Pandit 02-2-2017 03:57 AM

sql group by

group by statement is necessary since employees need to be selected from various department and group by executes in end and is compulsary here.


rishi 12-17-2016 01:04 PM

oracle

good answer

ravi 09-17-2014 07:23 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement