资源介绍
解法一:SELECT TNAME,DEPART FROM TEACHER A LEFT JOIN COURSE B USING(TNO) WHERE ISNUL
(B.tno);
解法二:select tname,depart from teacher a where not exists
(select * from course b where a.tno=b.tno);
解法三:SELECT TNAME,DEPART FROM TEACHER WHERE TNO NOT IN (SELECT TNO FROM COURSE);
NOT IN的方法效率最差,其余两种差不多
- 上一篇: sql语句强化练习习题及答案
- 下一篇: 数据库复习题及答案和sql语句练习