A: SELECT gender , SUM ( score ) FROM student GROUP BY gender HAVING SUM ( score )<;300;
B: SELECT gender , SUM ( score ) FROM student GROUP BY gender WHERE SUM ( score )300;
C: SELECT gender , SUM ( score ) FROM student WHERE SUM ( score )<;300 GROUP BY gender ;
D: 以上语句都不对
举一反三
- 查询student表中id字段值小于5,并且gender字段值为“女”的学生姓名的SQL语句是() A: SELECT name FROM student WHERE id<;5 OR gender='女'; B: SELECT name FROM student WHERE id<;5 AND gender='女'; C: SELECT name FROM student WHERE id<;5 ,gender='女'; D: SELECT name FROM student WHERE id<;5 AND WHERE gender='女';
- 查询student表中的gender字段(gender代表性别),使其查询记录中不能出现重复值的SQL语句是(1.0分) A: SELECT gender FROM student; B: SELECT DISTINCT * FROM student; C: SELECT DISTINCT gender FROM student; D: SELECT * FROM student;
- 【单选题】查询student表中id字段值小于5,并且gender字段值为“女”的学生姓名的SQL语句是 A. SELECT name FROM student WHERE id<5 OR gender‘女’; B. SELECT name FROM student WHERE id<5 AND gender=‘女’; C. SELECT name FROM student WHERE id<5 ,gender=‘女’; D. SELECT name FROM student WHERE id<5 AND WHERE gender=‘女’;
- 下列选项中,能够按照 score 由高到低显示 student 表中记录的 SQL 语句是 A: SELECT* FROM student ORDER BY score ; B: SELECT* FROM student ORDER BY score ASC ; C: SELECT * FROM student ORDER BY score DESC ; D: SELECT* FROM student GROUP BY score DESC ;
- 设有学生选课表score(sno,cname,grade),其中sno表示学生学号,cname表示课程名,grade表示成绩。以下能够统计每个学生选课数的语句是()。 A: SELECT<br/>COUNT(*) FROM score GROUP BY sno ; B: SELECT<br/>COUNT(*) FROM score GROUP BY cname ; C: SELECT<br/>SUM(*) FROM score GROUP BY cname ; D: SELECT<br/>SUM(*) FROM score GROUP BY sno ;
内容
- 0
将student表按照gender字段进行分组查询,查询出grade字段值之和小于300的分组,依据上述要求,下面选项中,正确的SQL语句是
- 1
从student表中查询学生姓名、年龄和成绩,结果按照年龄降序排序,年龄相同的按照成绩升序排序,下面SQL语句正确的是: A: select name, age, score from student order by age desc , score; B: select name, age, score from student order by age , score asc; C: select name, age, score from student order by 2 desc , 3 asc; D: select name, age, score from student order by 1 desc , 2;
- 2
下面用if语句统计“成绩(score)优秀的男生以及不及格的男生”的人数,正确的语句为_____。 A: if(gender=="男" and score <60 or score>=90): n+ = 1 B: if(gender=="男" and score <60 and score>=90): n+ = 1 C: if(gender=="男" and (score <60 or score>=90)): n+ = 1 D: if(gender=="男" or score <60 or score>=90): n+ = 1
- 3
要从SC表中查找缺成绩(SCORE)的学生学号(NO),相应的SQL语句是( )。 A: SELECT NO FROM SC WHERE SCORE = 0 B: SELECT NO FROM SC WHERE SCORE IS 'NULL' C: SELECT NO FROM SC WHERE SCORE = NULL D: SELECT NO FROM SC WHERE SCORE IS NULL
- 4
下列的查询语句哪一项是错误的(选一项) A: Select * from stumarks where score>=60 B: Select * from (select * from stumarks where score>=60) C: Select * from (select * from stumarks where score>=60) as temp D: Select * from (select * from stumarks ) as temp where score>=60