题解 | 网易云音乐推荐(网易校招笔试真题)

网易云音乐推荐(网易校招笔试真题)

https://www.nowcoder.com/practice/048ed413ac0e4cf4a774b906fc87e0e7

# 给1推荐他关注的人所喜欢的音乐
with
t1 as(
    select distinct
        music_id
    from
        follow as f
        left join music_likes as ml
        on f.follower_id=ml.user_id
    where
        f.user_id=1
),
t2 as(
    select
        music_id
    from
        music_likes
    where
        user_id=1
)

select
    music_name
from
    t1 left join music on t1.music_id=music.id
where
    not exists(
        select 1 from t2 where t1.music_id=t2.music_id
    )
order by
    music.id

全部评论

相关推荐

求问!考研下岸,打算参加春招,我这个bg能进啥厂,或者需要搞点深度项目再投吗
Java抽象带篮子_...:直接海投,可以看看我的考研失利速成冲春招贴,里面详细写了简历怎么写,学哪些项目可以速成
点赞 评论 收藏
分享
粉红恶魔派星星:炸了,偶遇kpi面。面试官一直在忙自己的事情。1.手写责任链 2.手写快排 3.linux定时任务的命令 4.springboot的定时任务 5.问了一条实习
今天你投了哪些公司?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务