Skip to content
We areTOP 1%

Recyclable and Low Fat Products

EasyLeetCodeSQL: SELECT & Filtering
Solve on LeetCode(opens in a new tab)
Track your progress
First attempt
Re-solve after a few days
Final pass before interviews
Hint and exampleShow

Keep only the rows that satisfy two equality conditions at once by joining them with AND.

Example: foods(item, is_veg, is_spicy)

item    | is_veg | is_spicy
Paneer  | Y      | Y
Chicken | N      | Y
Dal     | Y      | N
SELECT item
FROM foods
WHERE is_veg = 'Y' AND is_spicy = 'Y';   -- returns Paneer

More in SQL: SELECT & Filtering

Sign in to track your progress

Your checkboxes, streak and activity heatmap are saved to your account and sync across devices. It is free.
Sign in with email

New here? Create an account