Skip to content

Commit be3c704

Browse files
authored
이지영 : [SQL] Move Rating_250111
1 parent 1d0c3af commit be3c704

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

SQL/17주차/JY_Move_Rating.sql

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
-- 1341. Movie Rating
2+
-- https://leetcode.com/problems/movie-rating/
3+
(SELECT name AS results
4+
FROM MovieRating a
5+
JOIN Users b
6+
ON a.user_id = b.user_id
7+
GROUP BY name
8+
ORDER BY COUNT(*) DESC, name
9+
LIMIT 1)
10+
11+
UNION ALL
12+
13+
(SELECT title AS results
14+
FROM MovieRating a
15+
JOIN Movies b
16+
ON a.move_id = b.move_id
17+
WHERE created_at like "2020-02%"
18+
GROUP BY title
19+
ORDER BY AVG(rating) DESC, title
20+
LIMIT 1);

0 commit comments

Comments
 (0)