题解 | #浙大不同难度题目的正确率#

浙大不同难度题目的正确率

https://www.nowcoder.com/practice/d8a4f7b1ded04948b5435a45f03ead8c

select difficult_level,sum(if(result = 'right',1,0))/count(result) as correct_rate

from question_practice_detail  as qpd
right join user_profile as up
on up.device_id = qpd.device_id
left join question_detail as qd
on qpd.question_id = qd.question_id

where university = '浙江大学' and difficult_level is not null

group by difficult_level
order by correct_rate


#关于三表连接的技巧:
# SELECT  A1,A2,C1,C2      --展示A表中的A1\A2字段和C表中的C1\C2
# FROM  B                         --中间表
# INNER JOIN A ON A.A1 = B.B1   --A表中的与B表中相同的字段
# INNER JOIN C ON C.C1 = B.B1    --C表中的与B表中相同的字段
# 具体怎么连接看需求

全部评论

相关推荐

AFBUFYGRFHJLP:直接去美帝试试看全奖phd吧
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务