1、 查询语法
1.1 查询指定列
语法:select 列名称1,列名称2... from 表名称
eg: select id,name from student
1.2 查询所有列
语法:select * from 表名称
eg: select * from student
2、 条件过滤
2.1.语法:select * from 表名称 where 条件…
-
eg:查询所有男生信息
select * from student where sex = '男'
-
eg: 查询分数大于50分的男生成绩和姓名
select name,math,sex from student where math > 50 and sex = '男'
-
eg: 查询分数等于45或者等于56
select * from student where math = 45 or math = 56
-
eg: 查询分数在70-80分的学生信息
select * from student where math between 70 and 80
-
eg: 查询地址在湖北或者湖南的学生姓名和地址
select name,address from student wher