This article brings you relevant knowledge aboutOracleadding statements, including the syntax and default values of adding statements and other related issues. I hope it will be helpful to everyone.
insert into 表名(列名列表) values(值列表);
Note:
1) Add a Record
2) The order, type and number of the value list corresponding to the column name list
3) In addition to numerical types, other types of values in the value list are enclosed in single quotes.
4) Assign a null value to a nullable column 4.1) Do not write this column in the column list 4.2) Write the value as null
5) Directly use the default value for a column with a default value 5.1 ) Do not write this column in the column list 5.2) Write the value as default
6) The column name list can be omitted. Note that the order of the value list must be consistent with the order of the columns when defining the table (not recommended)
select * from studentInfo;
insert into studentInfo(studentId,stuName,sex,age,phone ,email,address) values(1,'张三','男',21,'32165498747','zhang@126.com','北京海淀');
insert into studentInfo(studentId,stuName,sex,age,phone ,email,address) values('张三',1,'男',21,'32165498747','zhang@126.com','北京海淀');--类型不一致错误
insert into studentInfo(studentId,stuName,sex,age,phone ,email,address) values(2,'张帅','女',21,'32165498745','zhang@126.com');--没有足够的值
insert into studentInfo(studentId,stuName,sex,age,phone ,email,address) values(2,'张帅','男',21,'32165498745','zhang@126.com','北京海淀','描述'); --值过多
insert into studentInfo(studentId,stuName,sex,age,phone ,email) values(2,'张帅','男',21,'32165498745','zhang@126.com');
insert into studentInfo(studentId,stuName,sex,age,phone ,email,address) values(9,'大山','男',22,null,'oracle@126.com',null);
insert into studentinfo(studentId,stuName,age,phone,address) values(10,'李林',21,'14785236956','北京西城');
insert into studentInfo(studentid,stuname,sex,age, phone,email,address) values(11,'蔡徐坤',default,20,'45632178954',default,null);
insert into studentinfo values(12,'邓伦',default,22,null,null,default);
commit;
Recommended tutorial: "Oracle Video Tutorial"
The above is the detailed content of Summarize and organize Oracle’s add statements (summary sharing). For more information, please follow other related articles on the PHP Chinese website!