[LeetCode/SQL] 1341. Movie Rating

Sooyeon·2024년 1월 16일
0

문제풀이 

목록 보기
90/95
post-thumbnail

[LeetCode/SQL]


📌 1341. Movie Rating

문제

풀이

5명 이상의 직속 부하 직원이 있는 관리자를 찾아라

방법 I

WITH top_user AS (
    SELECT u.name AS results
    FROM Users AS u
    INNER JOIN MovieRating AS m ON u.user_id = m.user_id
    GROUP BY m.user_id
    ORDER BY COUNT(m.user_id) DESC, u.name
    LIMIT 1
),
top_movie AS (
    SELECT m.title AS results
    FROM Movies AS m
    INNER JOIN MovieRating AS r ON m.movie_id = r.movie_id
    WHERE r.created_at LIKE '2020-02-%'
    GROUP BY r.movie_id
    ORDER BY AVG(r.rating) DESC, m.title
    LIMIT 1
)

SELECT results FROM top_user
UNION ALL
SELECT results FROM top_movie;

1개의 댓글

comment-user-thumbnail
2024년 2월 14일

Nestled in the cocoon of cinematic enchantment, I embarked on a voyage through the silver screen, where stories unfolded like chapters in a grand epic, each revealing new facets of the human spirit. Tonight's cinematic selection promised an exploration of the human experience, inviting me to journey through the trials and tribulations of life itself. With each unfolding scene, I found myself drawn deeper into the narrative, captivated by the https://filmix-ac.online/ raw emotion and unbridled passion that permeated every frame. From the quiet moments of introspection to the thrilling crescendos of action, I reveled in the kaleidoscope of experiences that cinema had to offer. In those transcendent moments, I felt a profound connection to the characters and their journeys, as their triumphs and tribulations echoed the rhythms of my own life.

답글 달기