Debt Data: Inner Join

This page details a brief exploratory SQL analysis of World Bank international debt data, available as a public dataset in BigQuery. Tables used were the international debt table and the country summary table within the overall international debt dataset.

Data source: “International Debt” tables, 18 May 2017-4 November 2020, World Bank, accessed via Google BigQuery.

Individual table exploration

I began by using basic SELECT, FROM, WHERE, and ORDER BY clauses to get an idea of specific data points in each of the two tables. I focused on country codes and names, regions, indicator names, values, and years. I also used the DISTINCT statement to generate a list of unique region names used.

Calculation & Inner Join

I then calculated the average total debt per region, sorted in descending order by value. I used the INNER JOIN statement to return both the debt values from the debt table and the region names from the summary table, using the country code from both tables in the ON clause. I used aliasing for the table names and a WHERE clause to exclude null region values.

Visualization

Finally, I exported the results of the query from BigQuery into a CSV file and created a bar chart in Excel.