数据更新
- 插入数据
1.插入元组
insert into sc(sno,cno) values('20930','1')
2.插入子查询结果
insert into dept_age(Stept,Avg_age) select Stept,AVG(Sage) from Student group by Stept
- 修改数据
1.set子句
1)修改某一个元组的值update Student set Sage=22 where Sno='233'
2)修改多个元组的值update Student set Sage=Sage+1
3)带子查询的修改语句
update SC set Grade=0 where 'CS'=(select Stept from Student where Student.Sno=SC.Sno)
2.where子句
- 删除数据
1.删除某一个元组的值
delete from student where Sno='2321'
2.删除多个元组的值delete from sc
3.带子查询的删除语句delete from SC where 'CS'=(select Stept from Student where Student.Sno=SC.sno)