select * from 学生信息
select
学生编号 --查询的数据字段名称
from 学生信息 --查询的数据表名称
select
学生编号,学生姓名,性别,班级,院校 --查询的数据字段名称
from 学生信息 --查询的数据表名称
select
--在查询的字段后面指定字段的别名,增加字段的可读性
--as语句后面的字符串表示的是为该字段指定的别名
No as 编号,
sName as 姓名,
Sex as 性别,
BirthDay as 出生日期,
Phone as 联系电话,
Address as 联系地址
from employee
--查询的数据表名称
--查询学生信息表中的数据信息
select * from 学生信息
where 性别='女' --通过where子句指定查询条件
select * from 学生信息
where 性别<>'女' --使用不等号作为查询条件查询数据
select * from 学生信息
where 年龄<30 --在查询条件中使用小于号作为查询条件
select * from 学生信息
where 年龄>=30 --在查询条件中使用大于等于号作为查询条件
select * from 学生信息
where 年龄 Between 25 And 30 --使用Between语句查询区间数据
--在查询条件中使用And运算符查询数据
select * from 学生信息
where 班级='00406' And 性别='女'
--在查询条件中使用OR运算符查询数据
select * from 学生信息
where 班级='00406' OR 性别='女'
--在查询条件中使用AND运算符与OR运算符的组合方式查询数据
select * from 学生信息
where 性别='女' And 班级='00406' OR 籍贯='吉林辽源'
select * from 学生信息
where 联系地址 Like '吉林省长春市' --使用Like运算符查询,这里等价于“=”
select * from 学生信息
where 籍贯 Like '%吉林%' --查询“籍贯”类似于“吉林”的学生信息
--查询“籍贯”字段中开头字符为“吉林”,并且为4个字符的数据信息
select * from 学生信息
where 籍贯 Like '吉林__'
select * from 学生信息
where 学生姓名 Like '[王赵]%' --查询所有姓“王”或姓“赵”的学生信息