Keep order numbers' leading zeros (kite shop)
Type a CSV so order numbers stay text (0007, not 7) while quantities and prices become numbers.
- Level
- beginner
- Time
- ~6 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Choose types deliberately: identifiers are text even when they look like numbers.
Northwind Kites sells kites and accessories through three regional stores. Orders are exported from the till system every week.
Steps
- Use the first row as headers.
- Keep
OrderIDas text so values like0007keep their zeros. - Set
Qtyto a whole number andUnitPriceto a decimal number (en-US). - Keep only
OrderID,QtyandUnitPrice.
Your result must
- OrderID values keep their leading zeros
- Qty and UnitPrice are numbers
- Three columns in this order
Input
- OrderFile (file)
- Text file; first line: OrderID,Customer,Qty,UnitPrice
- Every field is text until you set types
Expected output columns
OrderID (text), Qty (number), UnitPrice (number)
| OrderID | Qty | UnitPrice |
|---|---|---|
| 0001 | 3 | 47.9 |
| 0002 | 2 | 15.32 |
| 0003 | 4 | 7.56 |