Topics / 🗄️ SQL, pandas & Data Analysis / 🗄️ Level 14: SQL Fundamentals

SQL exercise · about 5 minutes · free

HAVING a Good Time

WHERE filters rows. HAVING filters groups. Interviewers love this one.

HAVING filters after grouping, so it can use aggregates.

SELECT map FROM matches GROUP BY map HAVING COUNT(*) > 3
Flow: FROM / JOIN → WHERE (filters rows) → GROUP BY → HAVING (filters groups) → SELECT → ORDER BY / LIMIT. the order SQL actually runs inFROM / JOINWHEREfilters rowsGROUP BYHAVINGfilters groupsSELECTORDER BY / LIMITthe order SQL actually runs in
Your quest: Show maps whose average kills are above 10. Return map and AVG(kills) as avg_kills.
Starter code
-- groups with a high average
-- Run this first to see the matches table, then change it to answer the task.
SELECT *
FROM matches
LIMIT 5;

Try it in your browser → Free. Sign in with Google to run it. Your code runs on your device.

In this level you'll learn:
More in Level 14: SQL Fundamentals

Share on LinkedIn