← SQL Analyst Starter
Lesson 1 of 4
Filter with both conditions
Select paid orders strictly above a threshold.
Do the work
- SELECT declares the output columns.
- WHERE combines status and amount with AND.
- An amount equal to the threshold does not pass a strict > test.
See the method
SELECT order_id, amount FROM orders
Watch the walkthrough
Read the video transcript
- Filter with both conditions. SELECT order_id, amount FROM orders
- Filter with both conditions. Exclude pending order 2 and boundary order 3. Include paid orders 1, 4 and 7.
- Group without losing rows. Filter paid orders.
- Group without losing rows. Keep the North sale and the East orphan order; customer existence is not a condition.
- Join and keep unmatched orders. Orders are the left table.
- Join and keep unmatched orders. An inner join drops order 5 and order 6. Join on the ID.
- Treat NULL explicitly. Riley has NULL email; Casey has an empty email.
- Treat NULL explicitly. NULL and an empty string are different values.
The video works through all four course topics; the lesson demonstrations above focus on the current step.
Practice independently
Exercise 1
Find paid orders over $100
Open practice →Exercise 2Find West orders worth at least $120
Open practice →Take it further
Try a WITH expression to name the paid-order subset before filtering.