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

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

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

with follower as (
    select follower_id
    from follow
    where user_id ='1'
),
follower_music as (
    select distinct mu.music_name,mu.id
    from follower fo,music_likes ml,music mu
    where fo.follower_id=ml.user_id and ml.music_id=mu.id
),
user_1_music as (
    select mu_1.music_name
    from music_likes ml_1,music mu_1
    where ml_1.music_id=mu_1.id and ml_1.user_id = '1'
)
SELECT music_name
FROM follower_music
WHERE music_name NOT IN (
    SELECT music_name
    FROM user_1_music
) order by id;

全部评论

相关推荐

09-19 13:59
门头沟学院 Java
用微笑面对困难:Trae一下,如果真成了,他用了直接发字节起诉代码版权,,这个代码不商用是没问题的如果没成也是情理之中的。
点赞 评论 收藏
分享
想玩飞盘的菠萝蜜在春...:上交✌🏻也拒?
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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