Move the key column first and keep the rest in order (it assets)
Put AssetID first. Every other column keeps its current order, including columns added in future exports.
- Level
- intermediate
- Time
- ~7 min
- Task
- Build the query
- Access
- Free — no account needed
Loading the practice workspace…
About this exercise
What you'll practise
Reorder columns with a list computed from the table, so new columns aren't dropped or misplaced.
Quillstack (fictional) keeps an IT asset register exported from its device-management tool, which puts the asset ID in the middle.
Steps
- Move
AssetIDto be the first column. - Every other column stays in its current relative order. Future exports may add columns; keep them too.
- Column order is graded.
Your result must
- AssetID is first
- Other columns keep their order
- New columns are kept
Input
- Assets (table)
- Type: text
- Purchased: text
- AssetID: text
- Owner: text
- Model: text
Expected output columns
AssetID (text), Type (text), Purchased (text), Owner (text), Model (text)
| AssetID | Type | Purchased | Owner | Model |
|---|---|---|---|---|
| A-1 | Typ-70 | Pur-48 | Own-81 | Mod-44 |
| A-2 | Typ-18 | Pur-96 | Own-65 | Mod-35 |
| A-3 | Typ-49 | Pur-68 | Own-96 | Mod-75 |