Home  >  Article  >  Database  >  SQL 必知必会笔记13插入数据

SQL 必知必会笔记13插入数据

WBOY
WBOYOriginal
2016-06-07 17:39:01901browse

INSERT 用来将行插入(或添加)到数据库表。插入有几种方式: 插入完整的行; 插入行的一部分; 插入某些查询的结果。 1.1 插入完整的行 存储到表中每一列的数据在VALUES 子句中给出,必须给每一列提供一个值。如果某列没有值,则应该使用NULL 值(假定表允

INSERT 用来将行插入(或添加)到数据库表。插入有几种方式:

  • 插入完整的行;
  • 插入行的一部分;
  • 插入某些查询的结果。
  •  

    1.1 插入完整的行

    存储到表中每一列的数据在VALUES 子句中给出,必须给每一列提供一个值。如果某列没有值,,则应该使用NULL 值(假定表允许对该列指定空值)。各列必须以它们在表定义中出现的次序填充。基本的INSERT 语法:

    关键字是可选的 Customers , , , , , , , 10 NULL, 11 NULL);

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn