2018-05-09

2018-05-09  本文已影响0人  繁华落幕_川

Day02课程——Mysql数据入门

1.安装,使用

下载SQLyog
安装,破解
打开注册表注册
使用
填写需要的IP地址
用户名,密码 ,端口,数据库地址

2.常用表格通配符

% 多个字符
_ 单个字符
like 模糊查询
*所有全部

3.常用运算符

= > < <>

4.常用表格SQL语句单词

select 查询
from 来自哪里
where 筛选条件
count 总计
sum 求和
mux 最大值
min 最小值
AVG 平均值
like 模糊查询
order by 排序
asc 升序(由小到大)
desc 降序(由大到小)
int 整数后面不加' '
varchar 变长字符类型加' '号

5.常用表格过滤SQL语句

select * from 表名 where 字段名=字段值
select * from 表名 where 字段名>字段值
select * from 表名 where 字段名<字段值
select * from 表名 where 字段名<>字段值
select * from 表名 where 字段名 like '%字段值'

字段值';
字段值为数字时可不加''增加多个字段名时要加,

6.表格排序SQL语句

select * from 表名 order by 字段名 asc;
select * from 表名 order by 字段名 desc;

7.统计函数SQL语句

select count(字段名) from 表名;
select sum(字段名) from 表名;
select AVG(字段名)from 表名 ;
select max(字段名)from 表名 ;
select min(字段名)from 表名 ;

上一篇 下一篇

猜你喜欢

热点阅读