SELECT *
FROM 'international_debt.csv'
SELECT
COUNT(DISTINCT country_name) AS total_distinct_countries
FROM df_1;
SELECT
DISTINCT indicator_code as distinct_debt_indicators
FROM df_1
ORDER BY distinct_debt_indicators;
SELECT
ROUND(SUM(debt)/1000000, 2) AS total_debt
FROM df_1;
SELECT
country_name,
SUM(debt) AS total_debt
FROM df_1
GROUP BY country_name
ORDER BY total_debt DESC
LIMIT 1;
SELECT
indicator_code AS debt_indicator,
indicator_name,
AVG(debt) AS average_debt
FROM df_1
GROUP BY debt_indicator, indicator_name
ORDER BY average_debt DESC
LIMIT 10;
SELECT
country_name,
indicator_name
FROM df_1
WHERE debt = (SELECT
MAX(debt)
FROM df_1
WHERE indicator_code='DT.AMT.DLXF.CD');
SELECT
indicator_code,
COUNT(indicator_code) AS indicator_count
FROM df_1
GROUP BY indicator_code
ORDER BY indicator_count DESC, indicator_code DESC
LIMIT 20;
SELECT
country_name,
MAX(debt) AS maximun_debt
FROM df_1
GROUP BY country_name
ORDER BY maximun_debt DESC
LIMIT 10;