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

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

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

直接用平均就可以求出占比,外键同名可以直接用using,无需重命表名,这样不用处理字段重名
select difficult_level,
avg(if(result='right',1,0)) correct_rate
from user_profile
left join question_practice_detail
using(device_id)
join question_detail
using(question_id)
where university='浙江大学'
group by difficult_level
order by correct_rate


全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务