作业:
1. 查看岗位是teacher的员工姓名、年龄
2. 查看岗位是teacher且年龄大于30岁的员工姓名、年龄
3. 查看岗位是teacher且薪资在9000-1000范围内的员工姓名、年龄、薪资
4. 查看岗位描述不为NULL的员工信息
5. 查看岗位是teacher且薪资是10000或9000或30000的员工姓名、年龄、薪资
6. 查看岗位是teacher且薪资不是10000或9000或30000的员工姓名、年龄、薪资
7. 查看岗位是teacher且名字是jin开头的员工姓名、年薪
-表 : name age Salary post
create database oldboy;
use teacher
create table teacher(
id int unsigned auto_increment primary key,
age int not null default 0,
post varchar(32) not null default '',
name varchar(32) not null default '',
salary decimal(8,3)
)charset=utf8;
insert into teacher(age,name,post,salary) valuse (24,'nick',teacher,23000.467);
insert into teacher(age,name,post,salary) valuse (25,'tank',teacher,9500.467);
insert into teacher(age,name,post,salary) valuse (39,'alex',teacher,45000.467);
insert into teacher(age,name,post,salary) valuse (42,'egon',teacher,35030.467);
insert into teacher(age,name,post,salary) valuse (29,'jason',teacher,12000.467);
insert into teacher(age,name,post,salary) valuse (32,'lisa',teacher,10000);
insert into teacher(age,name) valuse (26,'jinlu');
select (name,age) from teacher where post= teacher;
select (name,age) from teacher where post= teacher and age > 30;
select (name,age,salary) from teacher where post= teacher and 9000 < salary < 10000;
select (post) from teacher where post != NULL;
select (name,age,salary) from teacher where post= teacher and (salary = 9000 or salary = 10000 or salary = 30000);
select name,age,salary from homework where job = 'teacher' and salary not in (10000,9000,30000);
select (name,salary) from teacher where post= teacher and like 'jin%';