查询tb表的所有数据 select * from tb

查询student表的全部数据,只显示id与name列 select id,name from student

查询student表的全部数据,只显示id与name列,给id列起别名为学号,给name列起别名为姓名 select id as 学号, name as 姓名 from student

查询student表中的学生都来自哪个城市的,显示城市名。提示:对city列进行去重查询 select distinct city from student

查询student表中分数score小于等于60分的所有数据 select * from student where score <= 60

查询student表中性别gender列 不为 '保秘’ 的所有数据 select * from student where gender != '保秘'

查询student表中城市city列是 '武汉' 或者 '长沙' 的所有数据 提示:成员运算符 select * from student where city in ('武汉','长沙')

查询student表中城市city列 即不是 '武汉' 也不是 '长沙' 的所有数据 提示:成员运算符 select * from student where city not in ('武汉','长沙')

查找student表中分数score大于80分并且年龄age<16岁的数据 select * from student where score>80 and age<16

查询student表,获取全部分数score大于80或者地址place在武汉的数据 select * from student where score>80 or place='武汉'

查找people表,获取年龄age在20-30岁的所有数据。包含年龄等于20与等于30的数据 select * from people where age between 20 and 30

查找hero表,找出名字name为两个字的所有数据 select * from hero where name like '__'

查找hero表,找出名字name中包含 '白' 的所有数据 select * from hero where name like '%白%'

查找hero表,找出所有姓名name以张开头的数据 select * from hero where name like '张%'

查找hero表,在所有数据中只显示前三条 select * from hero limit 3

查找hero表,在所有数据中只显示从下标从2开始的5条数据 select * from hero limit 2,5