本文用到3张表:
student(sno,sname,sage,ssex,sdept)、primary key(sno)
sc(sno,cno,score)、primary key(sno,cno)
course(cno,cname,cpno,ccredit)、primary key(cno)
insert、update、delete操作对象为:
1. 一个元组
2. 多个元组
3. 全表
insert into:插入一个元组
框架为:
insert into tableName(attribute1,attribute2......) values (attribute1's values,attribute2's values.....)
例子:
/两个括号里面的字段名位置一致
insert into student(sno,sname,sage) values (20200001,张三,20);
/当然,如果表结构中某一字段(列)可以为null,我们在插入时也可以为空
insert into student(sno,sname,sage) values (20200001,'张三',null);
/当表名后面没有括号,后面的values就只能按表的字段顺序给值
insert into student values (20200001,'张三',</