登录 注册
当前位置:主页 > 资源下载 > 在SQL语言基础中插入新行

在SQL语言基础中插入新行

  • 更新:2024-07-07 12:07:32
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

插入新行 * 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.