11

Chapter 11

WHERE & Filtering

Narrowing the result set. Predicates, boolean logic, pattern matches, null handling, and the small operators that change everything.

In this chapter

30

queries, easy → advanced

  1. 001Find employees with salary greater than 60000Read
  2. 002Find products whose name starts with "Pro"Read
  3. 003Find employees hired between 2020 and 2022Read
  4. 004Find customers whose email contains "gmail"Read
  5. 005Find all orders NOT in pending or cancelled statusRead
  6. 006Find employees with no manager (top-level)Read
  7. 007Find products with price between 100 and 500 AND in stockRead
  8. 008Find customers NOT from IndiaRead
  9. 009Find employees whose salary is above averageRead
  10. 010Filter employees using REGEXP pattern for emailRead
  11. 011Find products with NULL cost (cost unknown)Read
  12. 012Find orders placed in the last 30 daysRead
  13. 013Filter using HAVING with GROUP BYRead
  14. 014Find customers with more than 3 ordersRead
  15. 015Find employees with email matching company domainRead
  16. 016Filter with complex multi-condition logic using bracketsRead
  17. 017Find duplicate emails in customers tableRead
  18. 018Find employees whose salary rank in dept is in top 3Read
  19. 019Find employees with consecutive salary increasesRead
  20. 020Find orders with total greater than 1000Read
  21. 021Find products with low stock (less than 5)Read
  22. 022Find all premium tier customersRead
  23. 023Filter employees by multiple conditions with ORRead
  24. 024Find orders shipped within 24 hoursRead
  25. 025Find products with price ending in .99Read
  26. 026Find customers who joined in Q1 of any yearRead
  27. 027Find projects that are overdueRead
  28. 028Find employees with above-median salaryRead
  29. 029Find rows where any column contains a keywordRead
  30. 030Filter using array operator: any matching tagRead