MSSQL Server面试题整合 |
3 。表内容如下 请问各位高手,如何查问登陆工夫 间隔不超过5分钟的所有记录. 几道经典的SQL笔试题目(有答案) (2)表名:成就表 给出成就所有合格的学生信息(包括姓名、课程、分数),注:分数在60以上评为合格 select * from score where s_name not in (select s_name from score where score<60) 或者: (select s_name from score group by s_name having min(score)>=60) 给出均匀进价在2元以下的商品名称 select 名称 from 商品表 group by 名称 having avg(进价) < 2 (4)表名:高考信息表 给出高考总分在600以上的学生准验证号 select 准验证号 from 高考信息表 group by 准验证号 having sum( 成就) > 600 (5)表名:高考信息表 给出高考总分在600以上的学生准验证号 select 准验证号 from 高考信息表 where (数学+语文+英语+物理+化学) > 600
(四 部分) id gender age 查问出该俱乐部里男性会员和女性会员的总数 select gender,count(id) from club group by gender (二)表名:team delete from team where id not in ( select min(a1.id) from team a1 where a1.name=team.name ) delete from team where id not in ( select min(id) from team group by name) (三)表名:student name course score 查问出“张”姓学生中均匀成就大于75分的学生信息 select * from student where name in (select name from student group by name having avg(score) > 75) |