Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Exercise 3 of SQL Course to reflect changes in BQ HN dataset #449

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions learntools/sql/ex3.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

# (1) ProlificCommenters
prolific_commenters_query = """
SELECT author, COUNT(id) AS NumPosts
FROM `bigquery-public-data.hacker_news.comments`
SELECT `by` as author, COUNT(id) AS NumPosts
FROM `bigquery-public-data.hacker_news.full`
GROUP BY author
HAVING COUNT(id) > 10000
"""
Expand All @@ -19,7 +19,7 @@
# (2) NumDeletedPosts
deleted_posts_query = """
SELECT COUNT(1) AS num_deleted_posts
FROM `bigquery-public-data.hacker_news.comments`
FROM `bigquery-public-data.hacker_news.full`
WHERE deleted = True
"""
query_job = client.query(deleted_posts_query)
Expand Down Expand Up @@ -47,7 +47,7 @@ def check(self, results):
"""
prolific_commenters_query = \"""
SELECT author, COUNT(1) AS NumPosts
FROM `bigquery-public-data.hacker_news.comments`
FROM `bigquery-public-data.hacker_news.full`
GROUP BY author
HAVING COUNT(1) > 10000
\"""
Expand All @@ -62,7 +62,7 @@ class NumDeletedPosts(EqualityCheckProblem):
# Query to determine how many posts were deleted
deleted_posts_query = \"""
SELECT COUNT(1) AS num_deleted_posts
FROM `bigquery-public-data.hacker_news.comments`
FROM `bigquery-public-data.hacker_news.full`
WHERE deleted = True
\"""

Expand Down