Skip to content
Project: Analyze International Debt Statistics
Analyze International Debt Statistics
In this project, the international debt data collected by The World Bank was analyzed using SQL. The dataset contains information about the amount of debt (in USD) owed by developing countries across several categories. The following questions is used for the analysis:
- What is the number of distinct countries present in the database?
- What country has the highest amount of debt?
- What country has the lowest amount of repayments?
Below is a description of the table used:
international_debt table
international_debt table| Column | Definition | Data Type |
|---|---|---|
| country_name | Name of the country | varchar |
| country_code | Code representing the country | varchar |
| indicator_name | Description of the debt indicator | varchar |
| indicator_code | Code representing the debt indicator | varchar |
| debt | Value of the debt indicator for the given country (in current US dollars) | float |
Number of distinct countries present in the database
DataFrameas
num_distinct_countries
variable
-- num_distinct_countries
SELECT COUNT(DISTINCT country_name) AS total_distinct_countries
FROM international_debt;Country with the highest amount of debt
DataFrameas
highest_debt_country
variable
-- highest_debt_country
SELECT country_name,
SUM(debt) AS total_debt
FROM international_debt
GROUP BY country_name
ORDER BY total_debt DESC
LIMIT 1;Country with the lowest amount of repayments
DataFrameas
lowest_principal_repayment
variable
-- lowest_principal_repayment
SELECT country_name, indicator_name,
MIN(debt) AS lowest_repayment
FROM international_debt
WHERE indicator_code = 'DT.AMT.DLXF.CD'
GROUP BY country_name, indicator_name
ORDER BY lowest_repayment
LIMIT 1;