Humans not only take debts to manage necessities. A country may also take debt to manage its economy. For example, infrastructure spending is one costly ingredient required for a country's citizens to lead comfortable lives. The World Bank is the organization that provides debt to countries.
In this project, you are going to analyze international debt data collected by The World Bank. The dataset contains information about the amount of debt (in USD) owed by developing countries across several categories. You are going to find the answers to the following questions:
- 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 you will be working with:
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 |
You will execute SQL queries to answer three questions, as listed in the instructions.
-- num_distinct_countries
-- Write your query here...
SELECT COUNT(DISTINCT(country_code)) AS total_distinct_countries
FROM international_debt;-- highest_debt_country
-- Write your query here...
SELECT country_name, SUM(debt) AS total_debt
FROM international_debt
GROUP BY country_name
ORDER BY total_debt DESC
LIMIT 1;-- lowest_principal_repayment
-- Write your query here...
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;In this project, I analyzed international debt data collected by The World Bank, focusing on developing countries. The dataset included information about the amount of debt (in USD) owed by these countries across various categories. My goal was to answer three key questions:
Number of Distinct Countries: I determined the number of distinct countries present in the database. Country with the Highest Debt: I identified the country with the highest total amount of debt. Country with the Lowest Repayments: I found the country with the lowest amount of repayments for a specific debt indicator. I conducted the analysis using SQL queries on the international_debt table, which contains columns for country name, country code, debt indicator description, debt indicator code, and the debt value in current US dollars.