更多"[单选题]有students(学生)表,包含字段:SID(学号),Sn"的相关试题:
[单选题]在SQL Server中 有student(学生)表,包含字段:Sid(学号),SName(姓名),Score(成绩),现要将所有学生的成绩加10分,下列SQL语句正确的是()。
A.Update student set Score=Score+10 where Sid=1
B.Update * set Score=Score+10
C.Update * from student set Score=Score+10
D.Update student set Score=Score+10
[单选题]在SQL Server 2005中,假定grade (成绩)表中包含字段:sID(学号),cID (班级编号)、lang(语文课成绩)、math(数学课成绩),那么计算所有学生人数和各科最高成绩的SQL语句是(选一项)
A.SELECT COUNT(*),MAX(lang),MAX(math)FROM grade
B.SELECT COUNT(*),MAX(lang),MAX(math)FROM grade GROUP BY sID
C.SELECT SUM(*),MAX(lang),MAX(math)FROM grade GROUP BY sID
D.SELECT SUM(*),MAX(lang),MAX(math)FROM grade
[单选题]在SQL Server 2005中,假定grade(成绩)表中包含字段:sID(学号),cID(班级编号),lang(语文课成绩),math(数学课成绩),那么先按班级,后按语文成绩排序的SQL语句是(选一项)
A.SELECT * FROM grade GROUP BY lang,cId
B.SELECT * FROM grade GROUP BYcId,lang
C.SELECT * FROM grade ORDER BY lang,cld
D.SELECT * FROM grade ORDER BY cId,lang
[单选题]在SQL Server 2005中,假定grade(成绩)表中包含字段:sID(学号),lang(语文课成绩)。那么列出语文成绩在80分到90分的学生的SQL语句是(选一项)
A.SELECT * FROM grade WHERE lang IN (80,90)
B.SELECT * FROM grade HAVING lang IN (80,90)
C.SELECT * FROM grade WHERE lang BETWEEN 80 AND 90
D.SELECT * FROM grade HAVING lang BETWEEN 80 AND 90
[单选题]现有分数表score,包含字段:s_id(编号),c_id(科目编号),s_score(分数),哪条SQL()可以正确查询查询平均成绩大于60分的学生的学号和平均成绩
A.SELECT s_id,AVG(s_score)
FROM score
GROUP BY s_id
HAVING AVG(s_score)>60;
B.SELECT s_id,AVG(s_score)
FROM score
GROUP BY s_id
AND AVG(s_score)>60;
C.SELECT s_id,AVG(s_score)
FROM score
ORDER BY s_id
HAVING AVG(s_score)>60;
D.SELECT s_id,AVG(s_score)
FROM score
GROUP BY c_id
HAVING AVG(s_score)>60;
[单选题]在SQL Server 2005中,学生表student中包含字段: 学生编号sid(主键),学生姓名sName, 现在查询所有姓名重复的记录,以下语句正确的是(选一项)
A.select * from student where count(sid)>1
B.select a. * from student a,student b where a.sname=b.sname
C.select * from student where count(sid)>1 group by sName
D.select * from student group by sName having count(sid)>1
[单选题]现有表 student 包含学号(sid)、课程编号(course)和成绩(score)等字段,若想费查询所有课程总成绩大于 600 分的学生,并按总成绩降序排序,要求列出学号和总成绩,以下语句能实现的是?
A.select sid,sum(score)from student where sum(score)>600 group by course order by sum(score)desc.
B.select sid,sum(score)from student group by course having sum(score)>600 order by sum(score)dese:
C.select sid,sum(score) from student where sum(score)>600 group by sid order by sum(score)desc:
D.select sid,sum(score) from student group by sid having sum(score)>600 order by sum(score) desc;
[多选题]成绩表score_tb中字段score代表分数,以下()语句返回成绩表中的最低分。【选两项】
A.select max(score) from score_tb
B.select top 1 score from score_tb order by score asc
C.select min(score) from score_tb
D.select top 1 score from score_tb order by score desc
[多选题]有一个course(课程)表,包含字段:cName(课程名称),score(学分)。要从此表中查询所有学分不在1~4之间的课程名称,以下语句正确的是()。【选两项】
A.SELECT cName FROM course WHERE score IN(1,4)
B.SELECT cName FROM course WHERE score NOT BETWEEN 1 AND 4
C.SELECT cName FROM course WHERE score NOT BETWEEN 4 AND 1
D.SELECT cName FROM course WHERE score NOT (score>=1 AND score<=4)
[单选题] 在SQL Server 2005中, 有students (学生)表, 包含字段: STD(学号),SName (姓名), Grade (成绩). 现查找所有学员中成绩最高的前5名学员. 下列SQL语句正确的是(选一项)
A.SELECT TOP 5 FROM students ORDER BY Grade DESC
B.SELECT TOP 5 FROM students ORDER BY Grade
C.SELECT TOP 5 * FROM students ORDER BY Grade ASC
D.SELECT TOP 5 * FROM students ORDER BY Grade DESC
[单选题]学生成绩表grade中有字段score(float),现在要把所有在55分至60(包含两个边界值)之间的分数提高5分,以下SQL语句正确的是(选一项)
A.Update grade set score=score+5
B.Update grade set score=score+5 where score>=55 or score <=60
C.Update grade set score=score+5 where score between 55 and 60
D.Update grade set score=score+5 where score <=55 and score >=60
[单选题]现有表 student. 包含学号(sid)、班级(class)、 课程编号(course)和成绩(score)等字段, 若想要查询每个班级每门课的平均成绩.下列语句能实现的是?
A.select class, course, avg (score) from student group by class, course.
B.select class, course. avg(score) from student group by course。
C.select class, course, avg(score) from student group by course order by class;
D.select class, course, avg(score) from student group by class;
[单选题]在SQL Server 2005中,有student(学生)表,其结构为: sID(学号,int 型,主键),sName(姓名,varchar 型), birthday(出生日期,varchar 型),score(成绩,int型). 现要向学员表中插入一名学员的信息,下列SQL语句正确的是(选一项)
A.INSERT INTO students VALUES(1,'李刚','1999-01-01',80)
B.INSERT INTO students (sID,sName,birthday) VALUES(1,'李刚','1999-01-01',80)
C.INSERT INTO students VALUES(1,李刚,1999-01-01,80)
D.INSERT INTO students (sID,sName,brithday) VALUES (NULL,'李刚','1999-01-01')
[单选题]若“学生”表中存储了学号、姓名、成绩等字段,则“查询所有学生的姓名和成绩”的SQL语句是__________。
A.SELECT * FROM 学生
B.SELECT 姓名 成绩 FROM 学生
C.SELECT 姓名,成绩 FROM 学生
D.SELECT 姓名、成绩 FROM 学生
[单选题]现有产品表Products,包含字段:UnitPrice(商品单价),ProductId(产品编号),ProductName(商品名称),ProductClass(产品类别),从产品表Products中查询单价UnitPrice最高的商品单价,正确的SQL是()。
A.SELECT MIN (UnitPrice) AS 最高单价 FROM Products
B.SELECT AVG (UnitPrice) AS 最高单价 FROM Products
C.SELECT MAX (UnitPrice) AS 最高单价 FROM Products
D.SELECT MAX UnitPrice AS 最高单价 FROM Products
[单选题]若“学生”表中存储了学号、姓名、性别、成绩等字段,则“删除所有女学生记录”的SQL语句是__________。
A.DELETE FROM 学生 WHERE 性别=女
B.DELETE FROM 学生 WHERE 性别=“女”
C.DELETE * FROM 学生 WHERE 性别=“女”
D.DELETE * FROM 学生 WHERE 性别=“女%”
[单选题]若“学生”表中存储了学号、姓名、性别、成绩等字段,则“删除所有男学生记录”的SQL语句是__________。
A.DELETE FROM 学生 WHERE 性别=男
B.DELETE FROM 学生 WHERE 性别=“男”
C.DELETE * FROM 学生 WHERE 性别=“男”
D.DELETE * FROM 学生 WHERE 性别 LIKE“男%”
[单选题]若“学生”表中存储了学号、姓名、成绩等字段,则“查询所有姓张的学生姓名”的SQL语句是_________。
A.SELECT 姓名 FROM 学生 WHERE 姓名=“张%”
B.SELECT 姓名 FROM 学生 WHERE 姓名 LIKE 张%
C.SELECT * FROM 学生 WHERE 姓名 LIKE 张
D.SELECT 姓名 FROM 学生 WHERE 姓名 LIKE “张%”
[单选题]现有产品表Product,包含字段price(价格),productName(产品名称),cateId(分类编号),以下哪条SQL是查询每个分类的产品总数()。
A.select cateId 产品分类,count(productName) 产品数量 from Product group by cateId
B.select cateId 产品分类,sum(productName) 产品数量 from Product group by cateId
C.select cateId 产品分类,count(productName) 产品数量 from Product group by productName
D.select cateId 产品分类,max(productName) 产品数量 from Product group by cateId