480 views
0 votes
0 votes

You must display a salary increase of 10% for each employee plus their total compensation which includes their salary and commission. Some employees do not receive a commission


Review this SELECT statement:

SELECT sal * 1.10 "Salary", sal * 1.10 + comm "Total Compensation"

FROM emp;


What is the result of this statement?

(a) Only the new salary of all employees is displayed.

(b) The new salary and total compensation for each employee is displayed.

(c) A zero total compensation value is displayed for employees that do not receive a commission.

(d) The total compensation value is not displayed for employees that do not receive a commission. 
 

1 Answer

1 votes
1 votes
Answer is D

when commission value is null NULL then it will be added to the increased salary resulting in NULL ; when NULL + ANYVALUE = NULL VALUE

Related questions

1 votes
1 votes
3 answers
1
sh!va asked Feb 8, 2017
1,133 views
Consider the following relation instance myTablenum1num2100100100NULLNULL100NULLNULL Query 1:SELECT *FROM myTableWHERE num1 != NULL;Query 2:SELECT *FROM myTableWHERE num1...
0 votes
0 votes
2 answers
2
0 votes
0 votes
2 answers
4
sh!va asked Jan 24, 2017
1,827 views
Which statement is wrong about SQL?1. Some SQL versions will not allow HAVING clause without GROUP BY2. Some SQL versions will allow HAVING clause without GROUP BY3. Som...