Datastar_Meetup/demo/sqlite/dcountries.sql
2025-10-16 18:33:14 +02:00

17 lines
480 B
SQL

.headers on
.mode table
WITH raw AS (
SELECT
value AS country
FROM json_each(readfile('countries.json'))
)
SELECT
json_extract(country, '$.translations.deu.common') AS german_name,
json_extract(country, '$.population') AS population,
json_extract(country, '$.capital[0]') AS capital,
json_extract(country, '$.tld[0]') AS tld,
json_extract(country, '$.timezones') AS timezones
FROM raw
ORDER BY german_name;