题解 | #浙江大学用户题目回答情况#
浙江大学用户题目回答情况
http://www.nowcoder.com/practice/55f3d94c3f4d47b69833b335867c06c1
# 方法一 连表查询
# select qpd.device_id,qpd.question_id,qpd.result FROM
# question_practice_detail as qpd inner join user_profile as up on qpd.device_id = up.device_id
# where up.university = '浙江大学'
# 方法二 子查询
select device_id,question_id,result FROM question_practice_detail
where device_id =
(
select device_id from user_profile where university = '浙江大学'
)
# select qpd.device_id,qpd.question_id,qpd.result FROM
# question_practice_detail as qpd inner join user_profile as up on qpd.device_id = up.device_id
# where up.university = '浙江大学'
# 方法二 子查询
select device_id,question_id,result FROM question_practice_detail
where device_id =
(
select device_id from user_profile where university = '浙江大学'
)