39 - 电影评分(高频 SQL 50 题基础版)

39 - 电影评分






sql 复制代码
(select
    u.name as results
from
    MovieRating m left join Users u on m.user_id=u.user_id 
GROUP BY
    m.user_id
order by 
    count(*) desc,u.name asc limit 1)
union all
(select
    m1.title as results
from
    MovieRating m left join Movies m1  on m.movie_id=m1.movie_id    
where
    month(m.created_at)=2
group by
    m.movie_id
order by 
    avg(m.rating) desc,m1.title asc
limit 1);
相关推荐
北方有星辰zz1 小时前
线程的同步与互斥
数据库
goyeer2 小时前
【MYSQL】MySQL中On duplicate key update
数据库·mysql
一 乐2 小时前
心理咨询|学生心理咨询评估系统|基于Springboot的学生心理咨询评估系统设计与实现(源码+数据库+文档)
java·数据库·spring boot·后端·论文·毕设·学生心理咨询评估系统
TDengine (老段)3 小时前
TDengine IDMP 基本功能(1.界面布局和操作)
大数据·数据库·物联网·ai·时序数据库·tdengine·涛思数据
kushu73 小时前
MySQL 索引
数据库·mysql
bing_1584 小时前
Spring Boot @Validated 和@Valid 区别
java·数据库·spring boot
2501_920047035 小时前
MySQL-锁
数据库·mysql·adb
Zfox_6 小时前
Redis应⽤-缓存与分布式锁
服务器·数据库·redis·分布式·缓存
paopaokaka_luck6 小时前
基于SpringBoot+Uniapp的血压监控小程序(Echarts图形化分析)
数据库·vue.js·spring boot·mysql
上海云盾-高防顾问6 小时前
小白入门指南:Edge SCDN 轻松上手
数据库·安全·edge