插入新行-SQL语言基础

时间:2024-05-15 13:25:04
【文件属性】:

文件名称:插入新行-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:25:04

SQL 基础

插入新行 * SQL> INSERT INTO dept (deptno, dname, loc) 2 VALUES (50, 'DEVELOPMENT', 'DETROIT'); 1 row created. 插入包含每一个列值的新行. 按缺省顺序列出表中所有的列值. 列出 INSERT 子句中所有的列. 日期值和字符值要用单引号括起来. * INSERT INTO dept (deptno, dname, loc) VALUES (50, 'DEVELOPMENT', 'DETROIT'); Adding a New Row to a Table (continued) Because you can insert a new row that contains values for each column, the column list is not required in the INSERT clause. However, if you do not use the column list, the values must be listed according to the default order of the columns in the table. SQL> DESCRIBE dept Name Null? Type ------------------------------- -------- ------------ DEPTNO NOT NULL NUMBER(2) DNAME VARCHAR2(14) LOC VARCHAR2(13) For clarity, use the column list in the INSERT clause. Enclose character and date values within single quotation marks; do not enclose numeric values within single quotation marks. Instructor Note Number values should not be enclosed in single quotes, because implicit conversion may take place for numeric values assigned to NUMBER datatype columns if single quotes are included.


网友评论