数据库的建立
create database 名字;
调用该database
use 名字;
显示base
show databases;
表中增加列
alter table 表名 add 列名 + 类型;
表中更改类型
alter table 表名 modify 列名 + 类型;
表中删除列
alter table 表名 drop 列名;
删除表
drop table 表名;
where和having
- WHERE 查询条件中不可以使用聚合函数,而 HAVING 查询条件中可以使用聚合函数
- WHERE 在数据分组前进行过滤,而 HAVING 在数据分组后进行过滤