runtime
02 / 139

task WHERE · warm-up

Weather stations in the West

Return station_id, station_name and longitude for every station west of 100°W (longitude below −100).

what to return

Columns
station_idstation_namelongitude in this order
Rows
30 rows · any order
Skill
Filter rows with a numeric comparison. Refresher: Comparisons & ranges →

expected result

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

expected result30 rows · any order
station_idstation_namelongitude
USW00003131San Diego Montgomery Fld-117.1375
USW00003184Phoenix Deer Valley Muni Airport-112.0661
USW00022521Honolulu International Airport-157.9394

first 3 of 30 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

solution.sql
 

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

Weather stations in the West — SQL practice · Runtime