美文网首页
知识点总结

知识点总结

作者: 坏坏坏坏坏 | 来源:发表于2018-11-22 21:29 被阅读0次

    SQL中包含的动词

    数据定义

    create

    • 含义:创建表单或者视图
    • 用法:
      1.create table 表名 ();
      2.create view 视图名 AS select语句

    drop

    • 含义:删除表或者视图
    • 用法:
      drop 表类型(视图) 表名(视图名)

    alter

    • 含义:修改表格的内容
    • 用法:
    1. drop 删除某列
      (1)alter table 表名 drop column 字段名
    2. alter 修改字段类型
      (1)alter table 表名 alter column 字段名 字段类型
    3. add 添加约束或者字段类型
      (1) alter table 表名 add 约束 约束名 约束类型()
      (2)alter table 表名 add column 字段名 字段类型

    数据查询

    select

    • 含义:查询所选的内容
    • 用法:
      select 查询的内容 from 表名(视图名) where 查询的条件

    数据操作

    insert

    • 含义:给表单中填写内容
    • 用法:
      insert into 表名 values (表格内容)

    update

    • 含义:更新表中内容
    • 用法:
      update 表名 set 字段名 修改内容 where 字段名 被修改内容

    delete

    • 含义:删除表内容
    • 用法:
      delete from 表名 where 条件

    相关文章

      网友评论

          本文标题:知识点总结

          本文链接:https://www.haomeiwen.com/subject/ikchqqtx.html