赞
踩
知乎上有sql笔试练习,实际练一下
建表
ER图
表结构
表 | 结构 |
---|---|
学生表 | Student(sid,sname,sage,ssex) |
课程表 | Course(cid,sname,tid 教师编号) |
教师表 | Teacher(tid,tname) |
成绩表 | SC(sid,cid,score) |
1、查询“01”课程比“02”课程成绩高的所有学生的学号;
select distinct t1.sid as sid
from
(select * from sc where cid=01)t1
left join
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。