![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
测开路上的小白
这个作者很懒,什么都没留下…
展开
-
【sql相关】-高级 (下)
修改表 alert 添加列 alerttable表add字段名字段类型 删除列 alerttable表dropcloumn字段名 更改数据类型 alerttable表alertcolumn字段名新类型 生成新的唯一自增字段 auto_increment 建表时: 字段intauto_increment 视图view 创建视图 createview视图名asselect字段form表where... 查询视图 select*fro...原创 2021-10-19 14:30:39 · 148 阅读 · 0 评论 -
【sql相关】-函数 (完)
平均值 avg selectavg(字段)from表 数量 count selectcount(字段)from表 返回不同的数目 selectcount(distinct字段)from表 排名第一的 first selectfirst(字段)from表 选择最后的 last selectlast(字段)from表 最大值 max selectmax(字段)from表 最小值 min selectmin(字段)from表...原创 2021-10-10 23:22:50 · 78 阅读 · 0 评论 -
【sql相关】-高级 (上)
sql作为一门古老的语言,学习起来性价比超高!几十年都不用更新!本节内容为进阶高级复习题! 创建数据库 / 表 create database 数据库名 create table 表名 ( 字段1 varchar(255) 约束, 字段2 类型 约束, primary key (字段1) ... ) 约束 not null 不能为null unique 唯一 primary key 主键 foreign key 外键 default 默认 check 选择 删除数据库 / 表 drop .原创 2021-10-09 16:40:35 · 145 阅读 · 1 评论 -
【sql相关】-基础
sql作为一门古老的语言,学习起来性价比超高!几十年都不用更新! 查询语句 select 字段1,字段2 from 表 where 字段1='xxxx' 去重查询 select distinct 字段 from 表 where 符号 select * from 表 where 字段 符号 值 and 字段 2 符号 值 = 等于 <> 不等于 < 小于 > 大于 <= >= 小于等于 大于等于 between 在某个范围内 like 像 in 在某多个.原创 2021-10-09 15:31:13 · 112 阅读 · 1 评论