inster into teacher(`id`,`t_name`,`sex`,`birthday`,`title`,`depart`,`phone_number`,`salary`)values(10001,'刘日辉','男','1977-12-01','副教授','信息工程学院','18778837831',8888.88);
inster into teacher(`id`,`t_name`,`sex`,`birthday`,`title`,`depart`,`phone_number`,`salary`)values(10002,'陈老师','女','1989-09-06','讲师','信息工程学院','18778837838',7777.67);
4.2、查询数据
# 查询表所有数据select*from teacher;# 按姓名查询select*from teacher where t_name ='刘日辉';# 查询指定字段信息select`t_name`,`salary`from teacher;# 统计各类职称教师人数(group by title:按title进行分组,count(*) 统计每个组人数)select`title`,count(*)from teacher groupby title;# 查看最高工资,最低工资,平均工资selectmax(salary)as 最高工资,min(salary) 最低工资,avg(salary) 平均工资 from teacher;
4.3、删除数据
# 按ID删除deletefrom teacher where id=1;# 按名字删除deletefrom teacher where t_name='刘日辉';