Skip to content

Commit 36c72e9

Browse files
committed
change table to match updated dataset
1 parent 7a83948 commit 36c72e9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

learntools/sql/ex3.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99
# (1) ProlificCommenters
1010
prolific_commenters_query = """
11-
SELECT author, COUNT(id) AS NumPosts
12-
FROM `bigquery-public-data.hacker_news.comments`
11+
SELECT `by` AS author, COUNT(id) AS NumPosts
12+
FROM `bigquery-public-data.hacker_news.full`
1313
GROUP BY author
1414
HAVING COUNT(id) > 10000
1515
"""
@@ -19,7 +19,7 @@
1919
# (2) NumDeletedPosts
2020
deleted_posts_query = """
2121
SELECT COUNT(1) AS num_deleted_posts
22-
FROM `bigquery-public-data.hacker_news.comments`
22+
FROM `bigquery-public-data.hacker_news.full`
2323
WHERE deleted = True
2424
"""
2525
query_job = client.query(deleted_posts_query)
@@ -46,8 +46,8 @@ def check(self, results):
4646
_solution = CS(\
4747
"""
4848
prolific_commenters_query = \"""
49-
SELECT author, COUNT(1) AS NumPosts
50-
FROM `bigquery-public-data.hacker_news.comments`
49+
SELECT `by` AS author, COUNT(1) AS NumPosts
50+
FROM `bigquery-public-data.hacker_news.full`
5151
GROUP BY author
5252
HAVING COUNT(1) > 10000
5353
\"""
@@ -62,7 +62,7 @@ class NumDeletedPosts(EqualityCheckProblem):
6262
# Query to determine how many posts were deleted
6363
deleted_posts_query = \"""
6464
SELECT COUNT(1) AS num_deleted_posts
65-
FROM `bigquery-public-data.hacker_news.comments`
65+
FROM `bigquery-public-data.hacker_news.full`
6666
WHERE deleted = True
6767
\"""
6868

0 commit comments

Comments
 (0)