文件名称:数据库精选sql语句练习题 sql语句练习题
文件大小:8KB
文件格式:TXT
更新时间:2013-06-15 15:35:32
sql
解法一: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的方法效率最差,其余两种差不多