Skip to content
Worked Examples · Example 8.6

Q.The following query displays name and department number of all those employees who are earning salary between 20000 and 50000 (both values inclusive).

Yanam CbseNCERTSubjective· 2mImportance★★★★★
24% · 11/45 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Employees with salary between 20000 and 50000, showing name and department.

SELECT Ename, DeptId
FROM EMPLOYEE
WHERE Salary>=20000 AND Salary<=50000;

Output:

+----------+--------+
| Ename    | DeptId |
+----------+--------+
| Shabbir  | D01    |
| Joseph   | D03    |
| Sanya    | D02    |
| Nachaobi | D05    |
| Daribha  | D04    |
| Tanya    | D05    |
+----------+--------+ …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.