CBSE Class 12 Computer Science Question 10 of 78

Simple Queries in SQL — Question 3

Back to all questions
3
Question

Question 3

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.

Answer
SELECT ENAME, SAL
FROM empl
WHERE SAL NOT BETWEEN 2500 AND 4000;
Output
+----------+------+
| ENAME    | SAL  |
+----------+------+
| SMITH    |  800 |
| ANYA     | 1600 |
| SETH     | 1250 |
| MOMIN    | 1250 |
| AMIR     | 5000 |
| KULDEEP  | 1500 |
| SHIAVNSH | 2450 |
| ANOOP    | 1100 |
| JATIN    |  950 |
| MITA     | 1300 |
+----------+------+