-
Notifications
You must be signed in to change notification settings - Fork 4
LeetCode SL Medium Problem #25
Answered
by
iamAntimPal
IamShiwangi
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
All reactions
Answered by
iamAntimPal
Mar 22, 2025
# Write your MySQL query statement below
(
SELECT name AS results
FROM
Users
JOIN MovieRating USING (user_id)
GROUP BY user_id
ORDER BY COUNT(1) DESC, name
LIMIT 1
)
UNION ALL
(
SELECT title
FROM
MovieRating
JOIN Movies USING (movie_id)
WHERE DATE_FORMAT(created_at, '%Y-%m') = '2020-02'
GROUP BY movie_id
ORDER BY AVG(rating) DESC, title
LIMIT 1
);
Replies: 1 comment 1 reply
-
# Write your MySQL query statement below
(
SELECT name AS results
FROM
Users
JOIN MovieRating USING (user_id)
GROUP BY user_id
ORDER BY COUNT(1) DESC, name
LIMIT 1
)
UNION ALL
(
SELECT title
FROM
MovieRating
JOIN Movies USING (movie_id)
WHERE DATE_FORMAT(created_at, '%Y-%m') = '2020-02'
GROUP BY movie_id
ORDER BY AVG(rating) DESC, title
LIMIT 1
);
Beta Was this translation helpful? Give feedback.
All reactions
-
❤️ 1
1 reply
-
Thank You I understand that Question.
Beta Was this translation helpful? Give feedback.
All reactions
Answer selected by
IamShiwangi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment