1、MySQL
两类数据库:
1、关系型数据库:MySQL、Oracle、SqlServer
2、非关系型数据库:NoSQL(Not Only SQL):Redis、MongoDB
数据库管理工具
是安装在电脑上的一个服务,3306
数据库管理工具提供了可视化界面,用来管理数据库:
SQLyog、Navicat、DataGrip
IDEA集成了DataGrid
DataGrid连接失败的原因:
1、MySQL服务没有启动,手动开启:控制面板-管理工具-服务-MySQL启动
2、缺少驱动jar,下载即可
3、时区问题,在cmd输入命令:
set global time_zone='+8:00';
1.1 什么是数据库
database安装在计算机上的一个专门用来存储数据的仓库,也是一种服务
1.2 数据库存储引擎
存储引擎是如何存储数据、如何为数据建立索引、如何更新、查询数据等技术的具体实现方法。
MySQL提供了存储引擎,默认的存储引擎:InnoDB
show engines;
MySQL默认使用InnoDB存储引擎,InnoDB对事务的处理能力非常强大,是其他存储引擎所不能比的。
1.3 MySQL运算符
SQL是一种编程语言,专门用来操作数据库的
已命令行的形式完成堆数据的增删改查
CRUD
create 增
read 读-查
update 更新-修改
delete 删除
1.3.1 算术运算符
执行运算符
加减乘除
select id/10 from student;
比较运算符
比较大小,0-false 1-true
select id >= 6 from student;
逻辑运算符
与或非
select id >= 6 && cid > 1 from student;
select id >= 6 and cid > 1 from student;
1.3.2 特殊运算符
1、is null 判断是否为空
select name is null from student;
2、between and 判断值是否在某个区间内
select id,id between 1 and 5 from student;
select id,id between id >= 1 and id <= 5 from student;
3、in判断值是否在某个特定的集合内