题解 | 统计每个用户的平均刷题数
统计每个用户的平均刷题数
https://www.nowcoder.com/practice/f4714f7529404679b7f8909c96299ac4
select
up.university,
dtl.difficult_level,
round(count(prct.question_id)/count(distinct(prct.question_id)),4) as avg_answer_cnt
from
user_profile up,
question_practice_detail prct,
question_detail dtl
where
up.university = '山东大学'
and up.device_id = prct.device_id
and prct.question_id = dtl.question_id
group by
dtl.difficult_level;
内什么内连接外连接左连接右连接…瞎连接都不懂…只会用where这样
听说where效率低,但又有朋友说编译器会自行优化…
我就很好奇…
查看30道真题和解析