728x90
code_count_query = """
SELECT indicator_code, indicator_name, COUNT(1) AS num_rows
FROM `bigquery-public-data.world_bank_intl_education.international_education`
WHERE year = 2016
GROUP BY indicator_code, indicator_name
HAVING num_rows >= 175
ORDER BY num_rows DESC
"""
country_spend_pct_query = """
SELECT country_name, AVG(value) AS avg_ed_spending_pct
FROM `bigquery-public-data.world_bank_intl_education.international_education`
WHERE indicator_code = 'SE.XPD.TOTL.GD.ZS'
AND year BETWEEN 2010 AND 2017
GROUP BY country_name
ORDER BY avg_ed_spending_pct DESC
"""728x90
'<Kaggle-Course>' 카테고리의 다른 글
| 캐글 intro_to_sql/02-select-from-where (0) | 2023.03.15 |
|---|---|
| 캐글 intro_to_sql/03-group-by-having-count (0) | 2023.03.15 |
| 캐글 intro_to_sql/05-as-with (0) | 2023.03.15 |
| 캐글 intro_to_sql/06-joining-data (0) | 2023.03.15 |
| [캐글] Nested and Repeated Data 정답 (0) | 2023.03.13 |