SQL 学习笔记<五> 数据更新

INSERT INTO <表名>[(<属性列1>[,<属性列2>…])]

INSERT INTO SC(Sno, Cno) SELECT Sno, ‘1143’ FROM Student;

 

UPDATE SC SET Grade = NULL WHERE Cno = ‘1233’ AND Sno IN(

             SELECT Sno FROM Student WHERE Sdept = ‘Computer’);

 

DELETE FROM SC WHERE Sno IN(

             SELECT Sno FROM Student WHERE Sdept = ‘Computer’);

你可能感兴趣的:(学习笔记)