1.查询学生表
查询学生表中所有的学生信息
select * from student;

select distinct 学号,姓名 from student; # 表示对学号,姓名同时满足唯一性
select 学号 as 学生证号码, 姓名,出生日期as 生日; # as 对查询结果重命名
2.练习sql运行顺序。
select 子句最后运行,其他子按安书写顺序进行。
先在student表中查询学号=001的学生,然后显示该条件的结果。
eg:select * from student where 学号=001;
3. 算数运算符和比较运算符(+-*/, =,<>,>>=,<=)
select 教师名称 , 教师号 from teacher where 教师名称 is not null;
select 学号,姓名,出生日期 from student where 出生日期<'1995-05-22';
select 姓名, 出生日期 from student where 出生日期 BETWEEN'1991-01-01' and '1996-01-01';
select 学号,成绩 from score where 成绩>=70;
4.逻辑运算符
select 学号,成绩 from score where 成绩>=70 and 成绩<=99 ;
in 是or 的简便写法 // not in
select 姓名,性别 from student where 姓名 in('猴子','马云');// or where 姓名='猴子' or 姓名='马云'
5.模糊查询
猴% (2个字符,第一个字符猴开头)
%猴(2个字符,后面字符猴结尾)
%猴%(3个字符,中间字是猴)
select 姓名 from student where 姓名 like '%猴';