Practice exercises
30 graded exercises on real, messy public data. You've completed 0. Progress is saved only in this browser.
Earthquakes
- The five most recent earthquakesBeginnerSELECT, ORDER BY, LIMITto do
- How many earthquakes are in the table?BeginnerCOUNT(*)to do
- Magnitude 5 and upBeginnerWHEREto do
- Not every 'earthquake' is an earthquakeBeginnerDISTINCTto do
- Events per typeBeginnerGROUP BYto do
- COUNT(*) vs COUNT(column)BeginnerNULLs, COUNT(col)to do
- Find the rows with a missing placeBeginnerIS NULLto do
- California, spelled two waysIntermediateLIKE, inconsistent labelsto do
- Events per dayIntermediatesubstr, dates as textto do
- Bucket magnitudes into bandsIntermediateCASEto do
- The deepest eventIntermediateORDER BY with tiesto do
- Busy networksIntermediateHAVINGto do
Vehicles
- Vehicle records per model yearBeginnerGROUP BYto do
- -1 means 'not available'Beginnersentinel valuesto do
- Average CO2 the right wayIntermediatesentinels + AVGto do
- Blank is not NULLBeginnerblank strings vs NULLto do
- Give blanks a real labelIntermediateNULLIF, COALESCEto do
- How many ways to say 'drive type'?BeginnerDISTINCTto do
- Collapse drive labels into groupsIntermediateCASE + LIKEto do
- Automatic or manual?Intermediatetext parsingto do
- Most efficient non-plug-in cars of 2024Intermediatefiltering + ORDER BYto do
- Who has no cylinders?IntermediateNULL by groupto do
- Same car, many rowsIntermediateduplicates, HAVINGto do
- Best combined MPG per year (EVs excluded)Advancedwindow functionsto do
Population & joins
- Which rows are actually states?Beginnertext codesto do
- Five most populous states (2024)Beginnerfilter + sortto do
- Fastest growth 2020→2024Intermediatecalculated columnsto do
- Match earthquakes to US statesAdvancedJOIN on messy keysto do
- Events per million residentsAdvancedmulti-table JOINto do
- Population by Census regionIntermediateCASE mapping codesto do