题解 | #统计每个学校各难度的用户平均刷题数#

统计每个学校各难度的用户平均刷题数

https://www.nowcoder.com/practice/5400df085a034f88b2e17941ab338ee8

select
  university,
  difficult_level,
  sum(date) / count(university)
from
  user_profile a,
  (
    select
      device_id,
      count(b.question_id) date,
      difficult_level
    from
      question_detail a,
      question_practice_detail b
    where
      a.question_id = b.question_id
    group by
      device_id,
      difficult_level
  ) b
where
  a.device_id = b.device_id
group by
  university,
  b.difficult_level
order by
  university;
全部评论

相关推荐

许愿ssp的咸鱼很不想泡池子:import python as pyhton
点赞 评论 收藏
分享
黑皮白袜臭脚体育生:简历条例统一按使用了什么技术实现了什么功能解决了问题或提升了什么性能指标来写会好些,如使用布隆过滤器实现了判断短链接是否存在,大大提升了查询速度
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务