Computer Science
Write a query to display details of employees who are not getting commission from table Empl.
Answer
SELECT *
FROM empl
WHERE COMM IS NULL OR COMM = 0;
Output
+-------+-----------+-----------+------+------------+------+------+--------+
| EMPNO | ENAME | JOB | MGR | HIREDATE | SAL | COMM | DEPTNO |
+-------+-----------+-----------+------+------------+------+------+--------+
| 8369 | SMITH | CLERK | 8902 | 1990-12-18 | 800 | NULL | 20 |
| 8566 | MAHADEVAN | MANAGER | 8839 | 1991-04-02 | 2985 | NULL | 20 |
| 8698 | BINA | MANAGER | 8839 | 1991-05-01 | 2850 | NULL | 30 |
| 8839 | AMIR | PRESIDENT | NULL | 1991-11-18 | 5000 | NULL | 10 |
| 8844 | KULDEEP | SALESMAN | 8698 | 1991-09-08 | 1500 | 0 | 30 |
| 8882 | SHIAVNSH | MANAGER | 8839 | 1991-06-09 | 2450 | NULL | 10 |
| 8886 | ANOOP | CLERK | 8888 | 1993-01-12 | 1100 | NULL | 20 |
| 8888 | SCOTT | ANALYST | 8566 | 1992-12-09 | 3000 | NULL | 20 |
| 8900 | JATIN | CLERK | 8698 | 1991-12-03 | 950 | NULL | 30 |
| 8902 | FAKIR | ANALYST | 8566 | 1991-12-03 | 3000 | NULL | 20 |
| 8934 | MITA | CLERK | 8882 | 1992-01-23 | 1300 | NULL | 10 |
+-------+-----------+-----------+------+------------+------+------+--------+
Related Questions
Assertion. Both BETWEEN and IN operators can choose from a list of values.
Reason. The value ranges and a list of values are interpreted in the same way in SQL.
Write a query to display EName and Sal of employees whose salary is greater than or equal to 2200 from table Empl.
Write a query to display employee name and salary of those employee who don't have their salary in the range of 2500 to 4000.
Write a query to display the name, job title and salary of employee who do not have manager.