task Column aliases · warm-up
Rename and convert a column
For every route that departs from JFK, return route_id, destination, miles (the distance_miles column) and km (miles × 1.609344, rounded to the nearest whole number).
what to return
- Columns
route_iddestinationmileskmin this order- Rows
- 55 rows · any order
- Skill
- Name output columns and calculated values. Refresher: Aliases & calculated columns →
expected result
Your query should return exactly these columns and values. Run it and compare.
expected result55 rows · any order
| route_id | destination | miles | km |
|---|---|---|---|
| 2512 | ATL | 760 | 1223 |
| 2513 | AUS | 1521 | 2448 |
| 2514 | BNA | 765 | 1231 |
first 3 of 55 rows
data you can query
U.S. Flights 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.
routes4 columns · 5,436 rows
| route_idnumber · unique id | origintext · links to airports | destinationtext · links to airports | distance_milesnumber |
|---|---|---|---|
| 1 | ABE | CLT | 481 |
| 2 | ABE | FLL | 1041 |
| 3 | ABE | MCO | 906 |
| 4 | ABE | MLB | 914 |
| 5 | ABE | MYR | 518 |
| 6 | ABE | PGD | 1018 |
- route_idnumber · unique id
- 1
- origintext · links to airports
- ABE
- destinationtext · links to airports
- CLT
- distance_milesnumber
- 481
- route_idnumber · unique id
- 2
- origintext · links to airports
- ABE
- destinationtext · links to airports
- FLL
- distance_milesnumber
- 1041
- route_idnumber · unique id
- 3
- origintext · links to airports
- ABE
- destinationtext · links to airports
- MCO
- distance_milesnumber
- 906
- route_idnumber · unique id
- 4
- origintext · links to airports
- ABE
- destinationtext · links to airports
- MLB
- distance_milesnumber
- 914
- route_idnumber · unique id
- 5
- origintext · links to airports
- ABE
- destinationtext · links to airports
- MYR
- distance_milesnumber
- 518
- route_idnumber · unique id
- 6
- origintext · links to airports
- ABE
- destinationtext · links to airports
- PGD
- distance_milesnumber
- 1018
first 6 of 5,436 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.