Keep SQLtest alive: Help cover this month's $100 server costs to keep all lessons and the SQL playground online. Support the project →
SQL code copied to buffer
Task 49:

Extract Airport Data as JSON

PostgreSQL
Your objective is to extract data from the airports_data table. Specifically, retrieve the airport_code along with a JSON object that includes the city name in English (from the city column) and the airport name in English (from the airport_name column). 
The output should have two columns: airport_code and airport_data, formatted as follows: {"city": "Yakutia", "name": "Polyarny Airport"}.
Expected result Columns: 2 · Rows: 104
airport_code airport_data

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial
The query result will appear here. Ctrl+Enter - Run query