Filter paid orders

Return order_id and amount for orders whose status is 'paid' and amount is at least 100. Include exactly 100; exclude NULL amounts. Row order does not matter.

Difficulty: beginner

Show hint

Combine the status check and amount comparison with AND.

Tables and sample data

Each test starts with fresh tables. Result rows may be returned in any order. Column names and column order must match.

Sample data: orders
order_id (integer)customer_id (integer)amount (numeric)status (text)region (text)
11150paidEast
2280paidWest
31200pendingEast
43100paidNorth
Expected sample result
order_idamount
1150
4100

Your solution

SQL · PostgreSQL

Results

PostgreSQL loads when you Run or Submit. Write one read-only SELECT or WITH query. Your query runs in this browser.

Back to Lesson