与WHERE AGE BETWEEN 18 AND 23完全等价的是()A、WHERE AGE>18AND AGE<23B、WHERE AGE>=18AND AGE<23C、WHERE AGE>18AND AGE<=23D、WHERE AGE>=18AND AGE<=23

题目

与WHERE AGE BETWEEN 18 AND 23完全等价的是()

  • A、WHERE AGE>18AND AGE<23
  • B、WHERE AGE>=18AND AGE<23
  • C、WHERE AGE>18AND AGE<=23
  • D、WHERE AGE>=18AND AGE<=23
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

对于学生信息表:student(sno,sname,sex,age,dept),能够得到年龄在20岁到22岁之间的学生的姓名和学号的语句是

A.SELECT * FROM student WHERE age BETWEEN 20 AND 22

B.SELECT sname,sno FROM student WHERE age BETWEEN 20 AND 22

C.SELECT sname,sno FROM student WHERE age>=20

D.SELECT sname,sno FROM student WHERE age<=22


正确答案:B
解析:A) 选项中,不是选择所有列;C) 选项年龄没有小于等于22岁;D) 选项年龄没有大于等于20岁。

第2题:

根据SQL标准,要查询表student中平均年龄age小于21的所在系dept及其平均年龄值,下面哪条语句适用?()

A select dept,avg(age) from student where avg(age)<21

B select dept,avg(age) from student group by dept having avg(age)<21

C select dept,avg(age) from student having avg(age)<21

D select dept,avg(age) from student group by dept where avg(age)<21


参考答案B

第3题:

使用SQL语句将学生表S中年龄(AGE)大于30岁的记录删除,正确的命令是( )。

A.DELETE FOR AGE>30

B.DELETE FROM S WHERE AGE>30

C.DELETE S FOR AGE>30

D.DELETE S WHERE AGE>30


正确答案:B

第4题:

根据SQL标准,要查询表student中所有年龄age小于所有学生的平均年龄的记录,下面哪条语句适用?()

A select * from student where age< avg(age)

B select * from student having age< avg(age)

C select * from student a where a.age< (select avg(b.age) from student b)

D select * from student a where (select avg(b.age) from student b ) >= a.age


参考答案C

第5题:

根据SQL标准,下面哪句语句能够找出年龄最小的同学?其中age为学生表student中的年龄字段,sno为学生的学号。()

A select max(age) from student

B select sno from student where age = max(age)

C select sno from student having age = max(age)

D select sno from student a where a.age<= (select min(b.age) from student b)


参考答案D

第6题:

对于学生信息表S(SNUMBER,SNAME,SEX,AGE,DEPT)(STUDENT由学号SN0,姓名SNAME,性别SEX,年龄AGE,所在系DEPT5个属性组成,其中SNUMBER为主码),求年龄20~23岁之间的学生姓名和年龄,正确的语句是( )。

A) SELECT SNAME, AGE FROM S WHERE AGE>20 OR AGE<23

B) SELECT SNAME, AGE FROM S WHERE AGE BETWEEN 20 AND 23

C) SELECT * FROM S WHERE AGE BETWEEN 20 AND 23

D) 以上均不正确


正确答案:B
需要查询的是姓名和年龄属性,故主句为SELECT SNAME,AGE。WHERE子句中可以使用BETWEEN进行查询,BETWEEN指定允许取值的范围,AND前面是低值,后面是高值。年龄在20到23岁之间的条件表达式应为BETWEEN 20AND 23。

第7题:

根据SQL标准,要修改表student中所有学生的年龄age,使之在原值基础上减一,下面哪个语句适用?()

A update student set age = 1

B update student set age = age - 1

C update age = age -1 from student

D update from student where age = age -1


参考答案B

第8题:

检索所有比“王华”年龄大的学生的姓名、年龄和性别,正确的SELECT语句是______。

A.SELECT SN,AGE,SEX FROM S SHERE AGE>(SELECT AGE FROM S WHERE SN='王华')

B.SELECT SN,AGE,SEX FROM S WHERE SN='王华'

C.SELECT SN,ACE,SEX FROM S WHERE AGE>(SELECT ACE WHERE SN='王华')

D.SELECT SN,ACE,SEX FROM S WHERE ACE>王华 AGE


正确答案:A
解析:本题考查的是书写SQL语句的能力。因为学生关系是S(S#,SN,SEX,AGE),课程关系是C(C#,CNAME,TEACHER),学生选课关系是SC(S#,C#,GRADE),学生关系与课程关系通过学生选课关系连接起来,要检索比“王华”年龄大的学生的姓名、年龄和性别,需要用的数据表为 S,因此选项A的语句
  SELECT SN,AGE,SEX FROM S
  SHERE AGE>(SELECTAGE FROM S
  WHERE SN='王华')。
  满足题目的含义,因此选项A应该是正确答

第9题:

根据SQL标准,下面哪条语句与select min(age) from student等效?()

A select age from student where age >= min(age)

B select distinct age from student where age >= all min(age)

C select distinct a.age from student a where a.age<= any (select distinctb.age from student b)

D select distinct a.age from student a where a.age<= all (select distinct b.age from student b)


参考答案D

第10题:

S(S#,SN,SEX,AGE,DEPT) C(C#,CN) SC(S#,C#,GRADE)其中:S#为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C#为课程号, CN为课程名,GRADE为成绩。检索所有比“王华”年龄大的学生姓名、年龄和性别。正确的SELECT语句是______。

A.SELECT SN,AGE,SEX FROM S WHERE AGE>(SELECT AGE FROM S WHERE SN='王华')

B.SELECT SN, AGE, SEX FROM S WHERE SN='王华'

C.SELECT SN,AGE,SEX FROM S WHERE AGE>(SELECT AGE WHERE SN='王华')

D.SELECT SN,AGE,SEX FROM S WHERE AGE>王华AGE


正确答案:A
解析:选项B查询的结果是显示出姓名为王华的学生姓名、年龄、和性别。
选项C在嵌套的SELECT语句中缺少必要的短语FROM。
选项D格式不正确。

更多相关问题