<Kaggle-Course>
-
캐글 intro_to_sql/03-group-by-having-count<Kaggle-Course> 2023. 3. 15. 15:37
prolific_commenters_query = """SELECT author, COUNT(id) AS NumPosts FROM `bigquery-public-data.hacker_news.comments` GROUP BY author HAVING COUNT(id) > 10000""" deleted_posts_query = """SELECT COUNT(1) AS num_deleted_posts FROM `bigquery-public-data.hacker_news.comments` WHERE deleted = True """
-
캐글 intro_to_sql/05-as-with<Kaggle-Course> 2023. 3. 15. 15:36
rides_per_month_query = """WITH cte AS ( SELECT EXTRACT(MONTH FROM trip_start_timestamp) AS month FROM `bigquery-public-data.chicago_taxi_trips.taxi_trips` WHERE EXTRACT(YEAR FROM trip_start_timestamp) = 2017 ) SELECT month, COUNT(1) AS num_trips FROM cte GROUP BY month ORDER BY month """ rides_per_year_query = """WITH cte AS ( SELECT EXTRACT(YEAR FROM trip_start_timestamp) AS year FROM `bigq..
-
캐글 intro_to_sql/04-order-by<Kaggle-Course> 2023. 3. 15. 15:35
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_..
-
캐글 intro_to_sql/06-joining-data<Kaggle-Course> 2023. 3. 15. 15:26
questions_query = \ """ SELECT id, title, owner_user_id FROM `bigquery-public-data.stackoverflow.posts_questions` WHERE tags LIKE '%bigquery%' """ answers_query = \ """ SELECT pa.id, pa.body, pa.owner_user_id FROM `bigquery-public-data.stackoverflow.posts_questions` AS pq INNER JOIN `bigquery-public-data.stackoverflow.posts_answers` AS pa ON pq.id = pa.parent_id WHERE pq.tags LIKE '%bigquery%' "..
-
[캐글] Nested and Repeated Data 정답<Kaggle-Course> 2023. 3. 13. 18:49
Introduction Now that you know how to query nested and repeated data, you're ready to draw interesting insights from the GitHub Repos dataset. Before you get started, run the following cell to set everything up. # Set up feedback system from learntools.core import binder binder.bind(globals()) from learntools.sql_advanced.ex3 import * print("Setup Complete") Exercises 1) Who had the most commits..