#配合前面,录入基础数据
INSERT INTO `think_user` VALUES ('1', '黄振国', '1', '32');
INSERT INTO `think_user` VALUES ('2', '张金女', '0', '27');
INSERT INTO `think_user` VALUES ('3', '黄佳敏', '0', '2');
INSERT INTO `think_user` VALUES ('4', '黄美嘉', '0', '7');
INSERT INTO `think_user` VALUES ('5', '黄佳滢', '0', '7');
#查询
select * from think_user where id>2
#插入
insert into think_user(name,sex,age) values('黄振帮',1,35)
#删除
delete from think_user where id>5
#更新
update think_user set age=3 where name='黄佳滢'
#查找
select * from think_user where name like '%佳%'
#排序
select * from think_user order by age desc
#总数
select count(*) as totalcount from think_user
#求和
select sum(age) as sumvalue from think_user
#平均
select avg(age) as avgvalue from think_user
#最大
select max(age) as maxval from think_user
#最小
select min(age) as minval from think_user
|