🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 79:

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

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

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