runtime
90 / 139

task Medians, shares & ratios · medium

Observation coverage by station

For 2023, return station_id, reported_days, tmax_days (days with a known tmax_c) and coverage_pct: reported_days ÷ 365 × 100, rounded to 1. Include stations with no 2023 rows as 0.

what to return

Columns
station_idreported_daystmax_dayscoverage_pct in this order
Rows
100 rows · any order
Skill
Measure completeness against a calendar. Refresher: CROSS JOIN & a complete date grid →

expected result

Your query should return exactly these columns and values. Run it and compare.

expected result100 rows · any order
station_idreported_daystmax_dayscoverage_pct
USW00003131365365100
USW00003184365363100
USW00003822365365100

first 3 of 100 rows

data you can query

Weather dataset: the first 6 rows of each table. Under each column name: the kind of value it holds, and which table it links to. Your queries run on all rows.

stations10 columns · 100 rows
station_idtext · unique idstation_nametextcity_idnumber · links to citiesis_primarynumberlatitudedecimallongitudedecimalelevation_mdecimalfirst_observationdatelast_observationdatereported_daysnumber
USW00003131San Diego Montgomery Fld10132.8144-117.1375127.42022-01-012024-12-311096
USW00003184Phoenix Deer Valley Muni Airport5133.6903-112.0661453.22022-01-012024-12-311096
USW00003822Savannah International Airport24132.1314-81.20228.82022-01-012024-12-311096
USW00003888Atlanta Fulton Co Airport23133.7775-84.5247245.12022-01-012024-12-311095
USW00003928Wichita32137.6544-97.4431426.72022-01-012024-12-311096
USW00003960Cahokia St Louis Dwtn Airport45138.5639-90.1486123.42022-01-012024-12-311096
station_idtext · unique id
USW00003131
station_nametext
San Diego Montgomery Fld
city_idnumber · links to cities
10
is_primarynumber
1
latitudedecimal
32.8144
longitudedecimal
-117.1375
elevation_mdecimal
127.4
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1096
station_idtext · unique id
USW00003184
station_nametext
Phoenix Deer Valley Muni Airport
city_idnumber · links to cities
5
is_primarynumber
1
latitudedecimal
33.6903
longitudedecimal
-112.0661
elevation_mdecimal
453.2
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1096
station_idtext · unique id
USW00003822
station_nametext
Savannah International Airport
city_idnumber · links to cities
24
is_primarynumber
1
latitudedecimal
32.1314
longitudedecimal
-81.2022
elevation_mdecimal
8.8
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1096
station_idtext · unique id
USW00003888
station_nametext
Atlanta Fulton Co Airport
city_idnumber · links to cities
23
is_primarynumber
1
latitudedecimal
33.7775
longitudedecimal
-84.5247
elevation_mdecimal
245.1
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1095
station_idtext · unique id
USW00003928
station_nametext
Wichita
city_idnumber · links to cities
32
is_primarynumber
1
latitudedecimal
37.6544
longitudedecimal
-97.4431
elevation_mdecimal
426.7
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1096
station_idtext · unique id
USW00003960
station_nametext
Cahokia St Louis Dwtn Airport
city_idnumber · links to cities
45
is_primarynumber
1
latitudedecimal
38.5639
longitudedecimal
-90.1486
elevation_mdecimal
123.4
first_observationdate
2022-01-01
last_observationdate
2024-12-31
reported_daysnumber
1096

first 6 of 100 rows · your queries use all of them

daily_weather10 columns · 109,214 rows
station_idtext · links to stationsobservation_datedate · links to calendartmax_cdecimaltmin_cdecimalprecipitation_mmdecimalprecip_tracenumbersnowfall_mmdecimalsnow_depth_mmdecimalavg_wind_speed_msdecimalpeak_gust_msdecimal
USW000031312022-01-0117.27.200NULLNULL26.3
USW000031312022-01-0220500NULLNULL1.15.4
USW000031312022-01-0317.83.900NULLNULL1.14.5
USW000031312022-01-0417.24.400NULLNULL1.44.5
USW000031312022-01-0521.15.600NULLNULL0.94
USW000031312022-01-0622.27.200NULLNULL0.63.6
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-01
tmax_cdecimal
17.2
tmin_cdecimal
7.2
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
2
peak_gust_msdecimal
6.3
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-02
tmax_cdecimal
20
tmin_cdecimal
5
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
1.1
peak_gust_msdecimal
5.4
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-03
tmax_cdecimal
17.8
tmin_cdecimal
3.9
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
1.1
peak_gust_msdecimal
4.5
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-04
tmax_cdecimal
17.2
tmin_cdecimal
4.4
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
1.4
peak_gust_msdecimal
4.5
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-05
tmax_cdecimal
21.1
tmin_cdecimal
5.6
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
0.9
peak_gust_msdecimal
4
station_idtext · links to stations
USW00003131
observation_datedate · links to calendar
2022-01-06
tmax_cdecimal
22.2
tmin_cdecimal
7.2
precipitation_mmdecimal
0
precip_tracenumber
0
snowfall_mmdecimal
NULL
snow_depth_mmdecimal
NULL
avg_wind_speed_msdecimal
0.6
peak_gust_msdecimal
3.6

first 6 of 109,214 rows · your queries use all of them

solution.sql
 

Hints and the answer are always available. Using them counts the question as solved with help.

Observation coverage by station — SQL practice · Runtime