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