select*from user where city='北京' order by credit asc select*from user where sex='男' order by personId asc select ename from user order by ename asc select city,count(userId) from user group by city select sex,avg(credit) from user group by sex select*from user select *from user where credit order by credit desc limit 0,3 select*from user where sex='男' order by credit asc limit 0,3 select city,avg(credit) from user group by city having avg(credit)>350