数据库学习知识点

查询语句基本结构
select + from + where + order by;

分类 投影操作 (select) 查询结果显示列

select 列名 from 表名 where 条件
* 指代查询显示所有

表前缀 select class.c_name form class8
列别名 select c_name as ‘姓名’ from class
字符拼接 select concat(c_name,’-‘,c_add) from stu;
排除重复数据 select distinct c_age from stu;
select distinct c_age,c_name from stu
## 组合查询排除重复
返回限定行数查询 select * from stu limit 0,3;
# 从第一行开始,查询3条数据
select * form stu limit 2
# 查询显示数据为 2 行

选择操作

       and             where id=1 and name=‘张’
       or              where id=1 or id=3
       between         where year between 18 and 20
       in (not in)     where year in (18,19,20)
       like            where iname=张%’  (模糊查询)

       处理控制数据   is null (not null)

排序操作 结果以什么顺序显示

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值