[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>流程控制语句
<>类似java中if else语句
<>类似java中switch case语句
<>聚合函数(不能进行嵌套使用MIN(AVG(salary)),但在oracle里支持)
聚合函数作用于一组数据,并对一组数据返回一个值。 AVG(),SUM(),MAX(),MIN(),COUNT()
<>GROUP BY(SELECT查询的字段必须是group by的字段,反之,group
by中声明的字段可以不出现在SELECT中,但是如果查询字段中有聚合函数的话是可以的)
<>HAVING的使用(如果过滤条件有聚合函数的话,放在where里就会有问题,所以只能放在having中)
<>SQL语法
<>SQL语句的执行过程
* 第一步:执行FROM
* 第二步:WHERE条件过滤
* 第三步:GROUP BY分组
* 第四步:执行SELECT投影列
* 第五步:HAVING条件过滤
* 第六步:执行ORDER BY 排序
<>子查询
<>相关子查询
<>EXISTS 与 NOT EXIST关键字
<>MYSQL数据类型
<>整数类型
<>日期类型
<>字符串类型
<>char和varchar区别
<>text类型
<>ENUM类型
<>Set类型
<>二进制类型
<>数据类型选择总结
<>约束
<>非空约束
在创建表时设置字段不为null
<>唯一约束(unique)
如果某个字段添加了唯一约束,也就说明这个值在这个表里是唯一的,不会出现第二个相同的值,但是如果向这个字段多次添加null时,是不会被限制的,是会被插入进去的。
<>复合性唯一约束
<>删除唯一性约束
<>主键约束(举一反三,有复合唯一约束,肯定也有复合主键约束)
一个表只有一个主键,特征是非空并且唯一
<>外键约束(FOREIGN KEY)
<>特征
* 一个表可以有多个外键
* 当删除数据时先删除子表才能删除主表
* 当添加外键约束时会创建对应的普通索引
<>约束等级
<>约束等级的使用
<>删除外键
<>开发场景(不建议使用外键约束,局限性太大)
<>SQL
<>什么是视图?
<>创建视图
create VIEW 视图名字 as sql语句
<>查看视图