8000 Update README.md · tcv-tclsbc/sql-50-leetcode@2597d2b · GitHub
[go: up one dir, main page]

Skip to content

Commit 2597d2b

Browse files
committed
Update README.md
1 parent 651c552 commit 2597d2b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,4 +568,28 @@ GROUP_CONCAT(DISTINCT product) AS 'products'
568568
FROM Activities
569569
GROUP BY sell_date
570570
ORDER BY sell_date
571+
```
572+
573+
[1341. Movie Rating](https://leetcode.com/problems/movie-rating/)
574+
575+
```sql
576+
(SELECT name AS results
577+
FROM Users u
578+
LEFT JOIN MovieRating mr
579+
ON u.user_id = mr.user_id
580+
GROUP BY name
581+
ORDER BY COUNT(rating) DESC, name ASC
582+
LIMIT 1)
583+
584+
UNION ALL
585+
586+
(SELECT title
587+
FROM Movies m
588+
LEFT JOIN MovieRating mr
589+
ON m.movie_id = mr.movie_id
590+
WHERE DATE_FORMAT(created_at, '%Y-%m') = '2020-02'
591+
GROUP BY title
592+
ORDER BY AVG(rating) DESC, title ASC
593+
LIMIT 1
594+
)
571595
```

0 commit comments

Comments
 (0)
0