最简单的查询语句
select * from employee1(表名);
这种查询可以查到表中的所有数据。
select name,salary,post from employee1;
根据自己的需要查看有关的信息。还有去重语句distinct(select distinct post from employee1;)
通过四则运算查询
select name,salary14 from employee1;
select name,salary14 anut_salary from employee1;
(select name,salary*14 as anut_salary from employee1;)
还可以定义显示的格式
concat() 函数用于连接字符串
条件查询
1、单条件查询
2、多条件查询
关键字between and
关键字is null
select name,salary,job_description from employee1 where job_description is null;
或者(select name,job_description FROM employee1 where job_description=’’;)
关键字in
关键字like模糊查询
通配符%
通配符’_’