注意的问题
修改数据upadte
与修改基本表alter
删除数据delete
与删除基本表drop
into子句
:指定要插入数据的表名以及属性列名values
子句:提供的值必须与into
子句匹配(包括个数和类型)insert into s values ('04050','张三', '男', '1997/10/01','信息');
全部指定属性列名:属性列顺序可自定
insert into s(sno,college,sname,ssex,sbirth) values ('04050','信息', '张三', '男','1997/10/01');
指定部分属性列:插入的元组在其余属性列上取空值
insert into s(sno,college,sname) values ('04050','信息', '张三');
insert into college_avg_age(college,avgage) select college,avg(2021-year(sbirth)) from s group by college;
update sc set grade=100 where college='信息');
update sc set grade=100 where sno in (select sno from s where college='信息');
delete from s where sno=‘04009’;
delete from sc where sno in (select sno from s where college=‘ ’);