zoukankan      html  css  js  c++  java
  • SQL语法

    select 列名称 from 表名称
    select * from 表名称

    insert into 表名称 values ('1','2','3',...) 插入新的行
    insert into 表名称 (列1,列2,...) values ('1','2','3',...) 指定所要插入数据的列

    insert into 表名称 select * from 表名称 //从其他表添加数据

    alter table 表名称 add 列名称 datatype //增加列


    update 表名称 set 列名称 = '新值' where 列名称 = '某值'
    修改数据


    delete from 表名称 where 列名称 = '值' //删除行

    delete from 表名称 //删除所有行

    alter table 表名称 drop column 列名称 //删除列 删除列之前该列所有的索引和约束必须首先删除

    truncate table 表名称 //删除整个表
    drop table 表名称 //删除表

    drop datebase 数据库名称 //删除数据库

    select 列名称 from 表名称 where 列 运算符 '值'
    条件选择

    select * from Persons where FirstName = 'Thoms' and LastName = 'Carter'

    and or


    select ID from Students order by student asc

    order by 排序(默认升序)
    asc 升序
    desc 降序排序

  • 相关阅读:
    Spring Boot第四弹,一文教你如何无感知切换日志框架?
    Spring Boot 第三弹,一文带你了解日志如何配置?
    UVa 1625
    UVa 11584
    UVa 11400
    UVa 12563
    UVa 116
    UVa 1347
    UVa 437
    UVa 1025
  • 原文地址:https://www.cnblogs.com/xslwm/p/9802867.html
Copyright © 2011-2022 走看看