• mysql 全部内容复习


    1.创建数据库
    create database 数据库名称
    删除数据库
    drop database 数据库名称
    
    2.创建表
    create table 表名
    (
        列名 类型(长度) 自增长 主键 非空,
    )
    自增长:auto_increment
    主键:primary key
    非空:not null
    外键:foreign key 列名 references 表名(列名)
    
    删除表
    drop table 表名
    
    3.CRUD操作
    
    insert into 表名 values(值)
    insert into 表名(列名) values(值)
    
    delete from 表名 where 条件
    
    update 表名 set 列名=值 where 条件
    
    select * from 表名
    select 列名 from 表名
    select * from 表名 where 条件
    select * from 表名 where 条件1 or 条件2
    select * from 表名 where 列名 like '%值%'
    select * from 表名 where 列名 between A and B
    select * from 表名 where 列名 in(值)
    select * from 表名 limit n,m
    select * from 表名 order by 列名 desc
    select * from 表名 group by 列名 having 条件
    select count(*) from 表名
    select sum(列名) from 表名
    select avg(列名) from 表名
    select max(列名) from 表名
    select min(列名) from 表名
    select distinct 列名 from 表名
    
    高级查询:
    1.连接查询
    select * from 表1,表2 where 连接条件
    select * from 表1 join 表2 on 连接条件
    
    2.联合查询
    select 列名 from 表1
    union
    select 列名 from 表2
    
    3.子查询
    无关子查询
    子查询和父查询没有关系,子查询可以单独执行
    select * fromwhere 列=(selectfrom 表)
    相关子查询
    子查询和父查询存在互相的关系,子查询需要用到父查询的内容
  • 相关阅读:
    使用NSIS打包程序
    vue.config.js 的完整配置(超详细)!
    前端 Electron Nsis Web 安装包配置方法
    使用NSIS制作安装包
    Echarts X轴(xAxis)
    Windows环境下Jenkins打包、发布、部署
    一、NSIS介绍
    织梦DEDECMS首页调用单页文档内容并带过滤HTML的方法
    php调试方法
    jQuery 图片轮播滚动效果
  • 原文地址:https://www.cnblogs.com/benpaodegegen/p/5983818.html
Copyright © 2020-2023  润新知