#为了分,我也是蛮拼的
#创建表开始
create table employee(
empid int primary key auto_increment,
name varchar(20) not null,
sex varchar(5) not null,
birth date not null,
level varchar(10) not null,
salary decimal(12,2) not null);
#表创建结束
#假设数据已插入
#查询开始 sel1. name 王% name,level
select empid,name,level from employee where name like '王%';
#sel2. 每种level的avg salary假设level有 经理和职工两种
select sum(salary)/count(salary) as '平均工资' from employee where level='经理';
select sum(salary)/count(salary) as '平均工资' from employee where level='职工';
#sel3.将empid=101的level update '经理';
#如果是这样,上面的表结构empid可以不为自动增量,楼主可以自己插入empid
update employee set level='经理' where empid=101;