create table student(
id int ,
name varchar(20),
sex varchar(20),
phone varchar(20),
address varchar(20),
primary key(id)
)default charset=utf8;
insert into student(id,name,sex,phone,address) values(1,'王封','男','10004','earth');
insert into student(id,name,sex,phone,address) values(2,'李小明','男','10001','earth');
insert into student(id,name,sex,phone,address) values(3,'百晓','男','10002','earth');
insert into student(id,name,sex,phone,address) values(4,'孙天应','男','10003','earth');
insert into student(id,name,sex,phone,address) values(5,'汪百辉','男','10006','earth');
insert into student(id,name,sex,phone,address) values(6,'王丁华','男','10005','earth');
%的意义为任意字符出现了任意次数
select * from student where name like'%天%';
%天%代表着带有一个天字的字符串.
select * from student where name like'%华';
%华代表着华结尾的字符串
select * from student where name like'汪%';
_ 和%的区别在于_的意义为任意字符出现了一次
select * from student where name like'%小_';