đ¯ Filter Employees by Salary and Department
In this mini tutorial, you'll learn how to filter employee records using SQL WHERE clause based on both salary and department. We use Bangladeshi names for a real-world feel.
đ Sample Employee Table
ID | Name | Department | Salary |
---|---|---|---|
301 | Sadia Rahman | IT | 68000 |
302 | Asif Mahmud | HR | 52000 |
303 | Mitu Akter | Sales | 71000 |
304 | Shuvo Hossain | IT | 80000 |
đ§Ē Example 1: IT Department with Salary Above 70,000
SELECT * FROM employees
WHERE department = 'IT' AND salary > 70000;
đ This query filters only those employees who work in the IT department and earn more than 70,000 taka.
đ§Ē Example 2: Sales or IT Department with Salary Between 65,000 and 75,000
SELECT * FROM employees
WHERE department IN ('IT', 'Sales') AND salary BETWEEN 65000 AND 75000;
đ This filters employees from Sales or IT department whose salary falls between 65,000–75,000.
đ Tip:
Use the AND
operator to combine salary and department filters. Use IN
or OR
to match against multiple departments.
✅ Try changing the salary value and department to test different combinations in your SQL practice tool.
āĻোāύ āĻŽāύ্āϤāĻŦ্āϝ āύেāĻ:
āĻāĻāĻি āĻŽāύ্āϤāĻŦ্āϝ āĻĒোāϏ্āĻ āĻāϰুāύ