Content-Length: 301221 | pFad | http://github.com/iamAntimPal/LeetCode_SQL_Database/discussions/25

0D LeetCode SL Medium Problem · iamAntimPal LeetCode_SQL_Database · Discussion #25 · GitHub
Skip to content

LeetCode SL Medium Problem #25

Answered by iamAntimPal
IamShiwangi asked this question in Q&A
Discussion options

You must be logged in to vote
# 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
);

Exxplanation

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@IamShiwangi
Comment options

Answer selected by IamShiwangi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/iamAntimPal/LeetCode_SQL_Database/discussions/25

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy