题解 | #浙江大学用户题目回答情况#
浙江大学用户题目回答情况
https://www.nowcoder.com/practice/55f3d94c3f4d47b69833b335867c06c1
# SELECT # u.device_id, # q.question_id, # q.result # from # question_practice_detail q, # user_profile u # where # university = '浙江大学' # and q.device_id = u.device_id # 对于多表查询,我们通过关键字 join 来连接两个表 # (两个表能连接的前提下,两表存在逻辑外键) # 格式为: # A join B on 逻辑外键 # 由于表名过长,我们给表明起一个别名,然后用join on ;连接表,取连接条件 select q.device_id,q.question_id,q.result from user_profile as u join question_practice_detail as q on u.device_id=q.device_id where u.university='浙江大学' order by q.question_id asc;