Skip to content
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