đŸŽ¯ Filter Employees by Salary and Department

đŸŽ¯ 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
301Sadia RahmanIT68000
302Asif MahmudHR52000
303Mitu AkterSales71000
304Shuvo HossainIT80000

đŸ§Ē 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.
SQL filter by salary, SQL filter by department, SQL WHERE clause, SQL AND operator, SQL IN clause, SQL BETWEEN example, SQL practice Bangladesh, SQL employee filtering, Bangla SQL tutorial, SQL for beginners

āĻ•োāύ āĻŽāύ্āϤāĻŦ্āϝ āύেāχ:

āĻāĻ•āϟি āĻŽāύ্āϤāĻŦ্āϝ āĻĒোāϏ্āϟ āĻ•āϰুāύ