--1、 基础查询
select id, name from student; -- 查询指定的字段
select * from student -- 查询所有字段
--2、WHERE 条件查询
select * from student where id=4;
select * from student where id>=4;
select * from student where id!=4;
select * from student where age >=19 and gender ='男';
select * from student where age >=19 or gender ='男';
select * from student where not age >=19;
select * from student where id in(1, 2, 4); -- 范围限定在指定的值中
select * from student where id between 1 and 4; -- 在一个范围内,包含边界
select * from student where class is null; -- 查 class 为null的数据
select * from student where class is not null; -- 查 class 不为null的数据
select * from student where name like '张%'; ---- %百分号是匹配任意个任意字符
select * from student where name like '张_'; ---- _下划线匹配一个任意字符
select * from student where name like '%三'; ---- 查询‘三’结尾,前面任意个任意字符
select * from student where name like '%三%'; ---- 查询包含‘三' 的数据