-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8e543f1
commit 6868d74
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
WITH | ||
Movie_Ranking AS ( | ||
SELECT | ||
Release_Date, | ||
Movie_Title, | ||
Production_Budget, | ||
RANK() OVER(PARTITION BY EXTRACT(YEAR FROM Release_Date) | ||
ORDER BY | ||
Production_Budget DESC) AS rank | ||
FROM | ||
`nttdata-c4e-bde.uc1_2.Movie` | ||
WHERE | ||
Release_Date BETWEEN '2016-01-01' | ||
AND '2020-12-31' ) | ||
SELECT | ||
EXTRACT(YEAR | ||
FROM | ||
Release_Date) AS year, | ||
Movie_Title, | ||
Production_Budget, | ||
rank | ||
FROM | ||
Movie_Ranking | ||
WHERE | ||
rank <=10 | ||
ORDER BY | ||
year DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
SELECT | ||
visitId, | ||
visitStartTime, | ||
h.page.pageTitle AS pageTitle, | ||
h.page.pagePath AS pagePath | ||
FROM | ||
`bigquery-public-data.google_analytics_sample.ga_sessions_20170801`, | ||
UNNEST(hits) AS h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
SELECT | ||
PARSE_DATE('%Y%m%d',date) date, | ||
h.page.pagePath pagePath, | ||
COUNT(h.page.pagePath) counter | ||
FROM | ||
`bigquery-public-data.google_analytics_sample.ga_sessions_201707*`, | ||
UNNEST(hits) AS h | ||
GROUP BY | ||
date, | ||
pagePath | ||
ORDER BY | ||
date, | ||
counter DESC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
SELECT | ||
DISTINCT us.id AS id_user, | ||
COUNT(pa.score) OVER(PARTITION BY PA.owner_user_id ORDER BY pa.owner_user_id) AS count | ||
FROM | ||
`bigquery-public-data.stackoverflow.posts_answers` pa | ||
INNER JOIN | ||
`bigquery-public-data.stackoverflow.users` us | ||
ON | ||
pa.owner_user_id = us.id | ||
AND extract(year from pa.creation_date) = 2010 | ||
ORDER BY | ||
count DESC | ||
LIMIT | ||
10 | ||
|