Public dataset · Economy, finance and crypto
World Bank World Development Indicators (WDI) in BigQuery
The World Bank's World Development Indicators: about 1,400 series (GDP, population, health, education, emissions, poverty) for 265 countries and aggregates, one row per country, indicator and year. 6 tables, 862 MiB; an indicator query scans about 0.3 GiB because the main table is not partitioned.
World Development Indicators is the World Bank's main collection of development statistics. indicators_data holds the values in long format: country_name, country_code, indicator_name, indicator_code, year and value, 7.9 million rows.
Three tables describe the data. series_summary has one row per indicator (1,442 rows) with the code, topic, definitions, unit, periodicity, source and license. country_summary has one row per country or aggregate (265 rows) with region, income group, currency and statistical notes. country_series_definitions, series_time and footnotes hold notes per country and series, per series and year, and per data point.
Indicator codes are the World Bank's own, for example NY.GDP.PCAP.CD (GDP per capita, current US$), SP.POP.TOTL (population) and SP.DYN.LE00.IN (life expectancy at birth). country_summary includes aggregates such as World and income groups as well as countries; in WDI, aggregates have no region, which is how you tell them apart.
Tables and sizes
| Table | Rows | Size | Full scan | Layout |
|---|---|---|---|---|
indicators_data | 7,872,673 | 798 MiB | under $0.01 | None |
footnotes | 714,064 | 59.2 MiB | under $0.01 | None |
series_summary | 1,442 | 3.5 MiB | under $0.01 | None |
country_series_definitions | 8,053 | 960 KiB | under $0.01 | None |
country_summary | 265 | 139 KiB | under $0.01 | None |
series_time | 507 | 47.3 KiB | under $0.01 | None |
Example queries
Find indicator codes by name
Search series_summary (3.5 MiB) for the code first; billed as 10 MB.
SELECT
series_code,
indicator_name,
topic
FROM `bigquery-public-data.world_bank_wdi.series_summary`
WHERE LOWER(indicator_name) LIKE '%co2 emissions%'
ORDER BY series_code;Top countries by GDP per capita in 2020
Reads country_name, indicator_code, year and value: 354 MiB.
SELECT
country_name,
ROUND(value) AS gdp_per_capita_usd
FROM `bigquery-public-data.world_bank_wdi.indicators_data`
WHERE indicator_code = 'NY.GDP.PCAP.CD'
AND year = 2020
ORDER BY gdp_per_capita_usd DESC
LIMIT 10;The same with country_code instead of country_name (cheaper)
Swapping the long name for the 3-letter code: 287 MiB. Join names from country_summary at the end if you need them.
SELECT
country_code,
ROUND(value) AS gdp_per_capita_usd
FROM `bigquery-public-data.world_bank_wdi.indicators_data`
WHERE indicator_code = 'NY.GDP.PCAP.CD'
AND year = 2020
ORDER BY gdp_per_capita_usd DESC
LIMIT 10;Population by World Bank region
Joins to country_summary and keeps rows with a region, which drops aggregates such as World so they are not double counted.
SELECT
c.region,
ROUND(SUM(d.value) / 1e6, 1) AS population_millions
FROM `bigquery-public-data.world_bank_wdi.indicators_data` AS d
JOIN `bigquery-public-data.world_bank_wdi.country_summary` AS c USING (country_code)
WHERE d.indicator_code = 'SP.POP.TOTL'
AND d.year = 2020
AND c.region IS NOT NULL
AND c.region != ''
GROUP BY c.region
ORDER BY population_millions DESC;World life expectancy over time
WLD is the World aggregate code.
SELECT
year,
ROUND(value, 2) AS life_expectancy_years
FROM `bigquery-public-data.world_bank_wdi.indicators_data`
WHERE indicator_code = 'SP.DYN.LE00.IN'
AND country_code = 'WLD'
ORDER BY year;Querying it cheaply
indicators_data(798 MiB) is not partitioned or clustered, so filtering onindicator_codeoryeardoes not reduce bytes. A filter onindicator_codereads that whole column for all 7.9 million rows.country_nameandindicator_namerepeat long strings on every row. Usecountry_codeandindicator_codeand join names from the small summary tables.- If you query a few indicators often, copy them once into your own table clustered by
indicator_code; later queries then read only the matching blocks.
FAQ
How much does it cost to query World Bank WDI in BigQuery?
The whole dataset is 862 MiB. A typical indicator query scans 0.28 to 0.35 GiB of indicators_data; lookups in the summary tables bill the 10 MB minimum. Both are tiny next to the 1 TiB monthly free tier.
Is the world_bank_wdi dataset free?
Google pays for storing public datasets, so you never pay storage for them. You pay only for the bytes your queries scan, billed to your own project at the on-demand rate, and the first 1 TiB scanned each month is free. See BigQuery pricing.
Why do my country totals look too big?
indicators_data includes aggregates (World, regions, income groups) alongside countries. Join to country_summary and keep only rows with a non-empty region before summing.
Related datasets
All public datasets · BigQuery cost queries · Pricing calculator
