File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change 1
1
1341 . Movie Rating
2
- Solved
3
- Medium
4
- Topics
5
- Companies
6
- SQL Schema
7
- Pandas Schema
2
+ " " "
8
3
Table: Movies
9
4
10
5
+---------------+---------+
@@ -95,4 +90,26 @@ Explanation:
95
90
Daniel and Monica have rated 3 movies (" Avengers" , " Frozen 2 " and " Joker" ) but Daniel is smaller lexicographically.
96
91
Frozen 2 and Joker have a rating average of 3.5 in February but Frozen 2 is smaller lexicographically.
97
92
93
+ " " "
98
94
95
+ # Write your MySQL query statement below
96
+ (
97
+ SELECT name AS results
98
+ FROM
99
+ Users
100
+ JOIN MovieRating USING (user_id)
101
+ GROUP BY user_id
102
+ ORDER BY COUNT (1 ) DESC , name
103
+ LIMIT 1
104
+ )
105
+ UNION ALL
106
+ (
107
+ SELECT title
108
+ FROM
109
+ MovieRating
110
+ JOIN Movies USING (movie_id)
111
+ WHERE DATE_FORMAT(created_at, ' %Y-%m' ) = ' 2020-02'
112
+ GROUP BY movie_id
113
+ ORDER BY AVG (rating) DESC , title
114
+ LIMIT 1
115
+ );
You can’t perform that action at this time.
0 commit comments