Filter with and/or conditions in the right grouping (kite shop)
Keep big orders from anywhere, plus non-cancelled orders from North or South. Parentheses matter.
- Level
- intermediate
- Time
- ~8 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Combine and/or conditions with explicit grouping.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
- Keep an order when either its
Qtyis 8 or more (any region, any status), or itsRegionis North or South and itsStatusisn'tCancelled. - Keep all columns.
Your result must
- Every order with Qty ≥ 8 kept
- North/South orders kept unless cancelled
- East orders under 8 dropped
Input
- Orders (table)
- OrderID: text
- Customer: text
- Region: text
- Product: text
- Qty: number
- UnitPrice: number
- OrderDate: text
- Status: text
Expected output columns
OrderID (text), Customer (text), Region (text), Product (text), Qty (number), UnitPrice (number), OrderDate (text), Status (text)
| OrderID | Customer | Region | Product | Qty | UnitPrice | OrderDate | Status |
|---|---|---|---|---|---|---|---|
| 0002 | Yara Tanaka | North | Delta Kite | 7 | 53.93 | 2026-03-25 | Complete |
| 0003 | Jun Ito | East | Delta Kite | 9 | 15.48 | 2026-02-21 | Cancelled |
| 0005 | Dmitri Zielinski | North | Reel | 1 | 51.23 | 2026-04-08 | Complete |