insert into instructor2 values(00001,'ai','math',2500.37);insert into instructor2 values(00002,'la','math',3700.89);insert into instructor2 values(00003,'bi','math',5400.45);insert into instructor2 values(00004,'ma','english',1450.23);insert into instructor2 values(00005,'ye','english',3421.34);insert into instructor2 values(00006,'er','technology',10000.65);
select course_idfrom section as Swhere semester='Fall' and year=2009 and exists(select * from section as T where semester='Spring' and year=2010 and S.course_id=T.course_id );
17.删除某些元组
从instructor关系中删除与‘math’系西席有关的全部元组
delete from instructorwhere dept_name='math';
18.删除全部元组
delete from instructor;
19.删除的特殊环境
内层语句只有一条元组。删除工资低于大学均匀工资的西席纪录。
delete from instructor2where salary < ( select avg(salary) from instructor2 );select *from instructor2;