一、
window端mysql免费版:
(未特别描述则不做更改直接点下一步)
下载地址:https://downloads.mysql.com/archives/installer
mysql安装好后添加path:
将MySQL安装目录的bin文件夹的路径复制,点新建添加:
C:\Program Files\MySQL\MySQL Server 8.0\bin
二、
使用跨平台、开源、免费的图形化工具:DBeaver操作MySQL:
https://dbeaver.io/download
我们选择免费的社区版(DBeaver Community)
直接都点下一步。
打开后提示:
会让安装驱动:
sql语句:
数据定义:DDL(Data Definition Language)
库的创建删除、表的创建删除等
数据操纵:DML(Data Manipulation Language)
新增数据、删除数据、修改数据等
数据控制:DCL(Data Control Language)
新增用户、删除用户、密码修改、权限管理等
数据查询:DQL(Data Query Language)
基于需求查询和计算数据
show databases;
use world;
show tables;
create table student(
id int,
name varchar(10),
age int
);
drop table student ;
insert into student (id) values (1),(2),(3);
insert into student (id,name,age) values (4,'周杰伦',12),(5,'阿大',11);
insert into student values (6,'阿斯达周杰伦',12),(7,"阿斯达阿大",11);
delete from student where id = 1;
delete from student where id < 4;
select * from student where id = 4;
update student set name = 'abc' where id =4;
drop table student ;
select 字段|聚合函数 from 表 [where 条件] group by 列;#方括号代表可以写可以不写
#注意,SELECT中,除了聚合函数外,GROUP BY 了哪个列,哪个列才能出现在SELECT中。
select age,count(age) from student group by age;
select age,count(age) from student group by age order by age;
select age,count(age) from student group by age order by age limit 4 ;
select age,count(age) from student group by age order by age limit 4,5 ;
三、
python使用mysql
导包: