Saturday, May 8, 2010

Calculations in SQL Query

0 comments
What are total earnings for sales reps?

SELECT LASTNAME, SALARY + BONUS + COMM
FROM EMP
WHERE JOB = 'FIELDREP'
Which operators have total earnings less then $20,000?
SELECT LASTNAME, SALARY + BONUS + COMM
FROM EMP
WHERE JOB = 'OPERATOR'
AND SALARY + BONUS + COMM < 20000

0 comments: