I am currently learning SQL for data analysis. In today’s exercise, I had to answer these questions:
*In 2015, how many people were of the official age for secondary education broken down by region of the world?
For this query, you will need to perform some additional tasks before returning the result:
- Exclude rows with a missing region.
- Use the SUM(value) to calculate the total population for a given grain size.
- Sort by highest population region first.*
And now to my problem: How do I find the correct name in a column with thousands of entries? To answer the question “how many people were of the official age for secondary education”
This text “Population of the official age for secondary education, both sexes (number)” was given to us. But how would I find it out if it wasn’t given?
Hier ist der Code den ich geschrieben hatte:
SELECT
summary.region,
SUM(edu.value) AS secondary_edu_population
FROM
bigquery-public-data.world_bank_intl_education.international_education
AS edu
INNER JOIN
bigquery-public-data.world_bank_intl_education.country_summary
AS summary
ON edu.country_code = summary.country_code
WHERE
summary.region IS NOT NULL
— here is the problem– AND edu.indicator_name = ‘Population of the official age for secondary education, both sexes (number)’
AND edu.year = 2015
GROUP BY summary.region
ORDER BY secondary_edu_population DESC
Viktor Neiwert is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.