题目内容

下列选项中,用于求出某个字段平均值的函数是( )。

A. avg()
B. max()
C. min()
D. total()

查看答案
更多问题

在学生关系student(sid,sname……)中,student的属性分别表示学号和姓名,若要查询学号为19170201的学生姓名,下列SQL语句正确的是( )。Ⅰ.SELECT sname FROM student WHERE sid LIKE '19170201'Ⅱ.SELECT sname FROM student WHERE sid LIKE= '19170201'Ⅲ.SELECT sname FROM student WHERE sid='19170201'

A. Ⅰ、Ⅱ
B. Ⅰ、Ⅲ
C. Ⅱ、Ⅲ
D. Ⅰ、Ⅱ、Ⅲ

在学生关系student(sid,xb……)中,student的属性分别表示学号和性别,若要统计student表中男、女学生的人数,下列SQL语句正确的是( )。

A. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student GROUP BY sid
B. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student GROUP BY xb
C. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student ORDER BY sid
D. SELECT xb AS '性别',COUNT(*) AS '人数' FROM student ORDER BY xb

有关系S(sid,sname,sage),C(cid,cname),SC(sid,cid,grade)。要查询选修“数据库技术”课程且年龄不小于20的全体学生的姓名的SQL语句是“SELECT sname FROM S,C,SC WHERE”,这里WHERE子句的内容是( )。

A. S.sid=SC.sid AND C.cid=SC.cid AND sage>=20 AND cname='数据库技术'
B. S.sid=SC.sid AND
C. cid=SC.cid AND sage IN 20 AND cname IN '数据库技术'C.S.sid=SC.sid AND sage>=20 AND cname='数据库技术'
D. C.cid=SC.cid AND sage IN 20 AND cname IN '数据库技术'

在学生关系student(sid,sname,nid)中,student的属性分别表示学号、姓名和民族编号,若要查询与张海是同一民族的学生的姓名,下列SQL语句正确的是( )。Ⅰ.SELECT s2.sname AS '姓名' FROM student s1,student s2 WHERE s1.nid=s2.nid AND s1.sname='张海'Ⅱ.SELECT sname AS '姓名' FROM student WHERE nid IN(SELECT nid FROM Student WHERE sname='张海')

A. Ⅰ
B. Ⅱ
C. Ⅰ、Ⅱ
D. Ⅰ、Ⅱ均不正确

答案查题题库