ProfessionalEnvironmentSQL+20 XP
Label rows High or Low
Scenario
You are a data analyst in the Environment team. CASE WHEN makes a new label column — an 'if this, then that' rule.
Question
Write your code in the editor, look at the result, then try changing one small thing.
Your task
- Write your code in the editor
- Press Check my answer
- Look at the result on the right
CASE WHEN
Read the simple theory: ExcelAdvanced · Record Counting & Duplicate Removal — question 9 of 30
1. Choose your dataset
Pick an industry and a size. Your code and results change to match.
sql editorwater_tests
Snippets
💡 Explain my whole code, line by line (hover any word in the editor for a tip)
🌈 In short — no coding words
📂 Opens the "water_tests" table→✅ Shows you the answer
Altogether: this query reads your industry table, picks what you need, and shows the answer as rows.
Start typing to see suggestions. Press Enter to use one. Red marks show the line to fix. Drag a bottom corner horizontally and vertically to resize.
Type your code here ↓
✍️ Tap here to type
Dataset & schema
water_tests
The tiny starter data. Bigger data scrolls.
Fields
| test_id | river | ph |
|---|---|---|
| W1 | Vaal | 7 |
| W2 | Orange | 6 |
| W3 | Vaal | 8 |
| W4 | Tugela | 5 |
Environment data only.
attempts: 0
▶ Output terminal
$ Press “Check my answer” — results appear here.Your next steps
Each item turns green when your answer includes it.
- Uses CASE WHEN
- Ends with END