//增 insert into student(name, age, stu_num, class) value ('卡卡西',28,6600,1);
//改 update student set name='鸣人' where id = 1; update student set name = '佐助', age=18, stu_num=6631, class=1 where id = 2; update student set id = 3, age=18, stu_num=6632, class=1 where name='小樱';
//查 select * from student; /*查询表中所有人*/
select name,age from student; /*查询表中所有人的名字和年龄*/
select * from student where age = 18; /*查询年龄为18的所有人*/
select count(1) from student; /*查询表中所有记录条数(在这里就是表中所有人总数)*/
select count(1) from student where age=18; /*查询表中年龄为18的人数*/
select sum(age) from student; /* 所有人的年龄加起来的总数*/
select avg(age) from student;/*求所有人的平均年龄*/
select avg(age) as avg_age from student; /*给平均数设置别名*/