16、要求男生(SEX=‘M’)年龄(AGE)在15到60之间,女生(SEX=‘F’)年龄在15到55之间,则正确的约束检查语句是()。A.CHECK(age>=15 AND ((SEX=’M’ AND AGE <=60) AND (SEX=’F’ AND AGE<=55)))B.CHECK(age>=15 AND ((SEX=’M’ AND AGE <=60) OR (SEX=’F’ AND AGE<=55)))C.CHECK(age>=15 OR ((SEX=’M’ AND AGE <=60) OR (SEX=’F’ AND AGE<=55)))D.CHECK(age>=15 OR ((SEX=’M’ AND AGE <=60) AND (SEX=’F’ AND AGE<=55)))
16、要求男生(SEX=‘M’)年龄(AGE)在15到60之间,女生(SEX=‘F’)年龄在15到55之间,则正确的约束检查语句是()。
A.CHECK(age>=15 AND ((SEX=’M’ AND AGE <=60) AND (SEX=’F’ AND AGE<=55)))
B.CHECK(age>=15 AND ((SEX=’M’ AND AGE <=60) OR (SEX=’F’ AND AGE<=55)))
C.CHECK(age>=15 OR ((SEX=’M’ AND AGE <=60) OR (SEX=’F’ AND AGE<=55)))
D.CHECK(age>=15 OR ((SEX=’M’ AND AGE <=60) AND (SEX=’F’ AND AGE<=55)))
参考答案和解析
CHECK(age>=15 AND ((SEX=’M’ AND AGE <=60) OR (SEX=’F’ AND AGE<=55)))
相关考题:
使用SQL语句向学生表S(SNO,SN,AGE,SEX)中添加一条新记录,字段学号(SNO)、姓名(SN)、性别(SEX)、年龄(AGE)的值分别为0401、王芳、女、18,正确命令是( )。A.APPEND INTO S (SNO,SN,SEX,AGE) VALUES (’0401’,’王芳’,’女’,18)B.APPEND S VALUES (’0401’,’王芳’ ,18,’女’)C.INSERT INTO S (SNO,SN,SEX,AGE) VALUES (’0401’,’王芳’,’女’,18)D.INSERT S VALUES (’0401’,’王芳’,18,’女’)
检索所有比“王华”年龄大的学生的姓名、年龄和性别,正确的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
对于学生信息表:student(sno,sname,sex,age,dept),能够得到年龄在20岁到22岁之间的学生的姓名和学号的语句是A.SELECT * FROM student WHERE age BETWEEN 20 AND 22B.SELECT sname,sno FROM student WHERE age BETWEEN 20 AND 22C.SELECT sname,sno FROM student WHERE age>=20D.SELECT sname,sno FROM student WHERE age<=22
对于学生信息表S(SNUMBER,SNAME,SEX,AGE,DEPT)(STUDENT由学号SN0,姓名SNAME,性别SEX,年龄AGE,所在系DEPT5个属性组成,其中SNUMBER为主码),求年龄20~23岁之间的学生姓名和年龄,正确的语句是( )。A) SELECT SNAME, AGE FROM S WHERE AGE20 OR AGE23B) SELECT SNAME, AGE FROM S WHERE AGE BETWEEN 20 AND 23C) SELECT * FROM S WHERE AGE BETWEEN 20 AND 23D) 以上均不正确
检索所有比"王华"年龄大的学生姓名、年龄和性别。正确的SELECT语句是() A、SELECT SN,AGE,SEX FROM SSHERE AGE>(SELECT AGE FROM S)WHERE SN=’王华’)B、SELECT SN,AGE,SEXFROM SWHERE SN=’王华’C、SELECT SN,ACE,SEX FROM SWHERE AGE>(SELECT ACEWHERE SN=’王华’)D、SELECT SN,ACE,SEX FROM SWHERE ACE>王华AGE
有学生信息表student,求年龄在20岁到22岁之间(含20岁和22岁)的学生姓名和年龄的 SQL语句是:SELECT sname, age FROM studentWHERE age ______;
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
如果学生表STUDENT是使用下面的SQL语句创建的CREATE TABLE STUDENT(SNO C(4) PRIMARY KEY NOT NULL,;SN C(8),;SEX C(2),;AGE N(2) CHECK(AGE>15 AND AGE<30))下面的SQL语句中可以正确执行的是A.INSERT INTO STUDENT(SNO,SEX,AGE)VALUES (“S9”,“男”,17)B.INSERT INTO STUDENT(SN,SEX,AGE)VALUES (“李安琦”,“男”,20)C.INSERT INTO STUDENT(SEX,AGE)VALUES (“男”,20)D.INSERT INTO STUDENT(SNO,SN)VALUES (“S9”,“安琦”,16)
关系SC(S,SNAME,SEX,SCORE,CNAME),从关系SC中检索男生(SEX =M)并且成绩大于等于60的学生姓名,下述表示( )是正确的。Ⅰ.ЛSNAME(σSCORE>60□SEX='M'(SC))Ⅱ.σSCORE>=60□SEX='M'(ЛSNAME(SC))Ⅲ.ЛSNAME(σSCORE>=60□SEX='M'(ЛSNAME,SCORE,SEX(SC))A.Ⅰ和ⅡB.ⅡC.Ⅰ和ⅢD.Ⅰ
S(S,SN,SEX,AGE,DEPT)C(C,CN)SC(S,C,GRADE)其中:S为学号,SN为姓名,SEX为性别,AGE为年龄,DEP 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
对于学生信息表STUDENT(SNO, SNAME,SEX,AGE,DEPT)(STUDENT由学号SNO、姓名SNAME、性别SEX、年龄AGE、所在系DEPT 5个属性组成,其中SNO为主码),求年龄20~23岁之间的学生姓名和年龄,正确的语句是( )。A.SELECT SNAME,AGE FROM STUDENT WHERE AGE20 AND AGE23B. SELECT*FROM STUDENT WHERE AGE BETWEEN 20 AND 23C.SELECT SNAME,AGE FROM STUDENT WHERE AGE BETWEEN 20 AND 23D.以上均不正确
如果学生表STUDENT是使用下面的SQL语句创建的: CREATE TABLE STUDENT(SNO C(4)PRIMARY KEY NOT NULL. SN C(8), SEX C(2), AGE N(2)CHECK(AGE15 AND AGE25)) 下面的SQL语句中可以正确执行的是( )。A. INSERT INTO STUDENT(SN,SEX,AGE)VALUES(”王磊”,”男”,20)B. INSERT INTO STUDENT(SN0,SEX,AGE)VALUES(”S9”,”男”,17)C. INSERT INTO STUDENT(SEX,AGE)VALUES(”男”,20)D. INSERT INTO STUDENT(SN0,SN,AGE)VALUES(”S9”,”王磊”,14)
对于学生信息表:student(sno,sname,sex,age,dept),能够得到年龄在20岁于22岁之间的学生的姓名和学号的语句是A.SELECT * FROM student WHERE age BETWEEN 20 AND 22B.SELECT sname,sno FROM student WHERE age BETWEEN 20 AND 22C.SELECT sname,sno FROM student WHERE age>=20D.SELECT sname,sno FROM student WHERE age<=22
如果学生表STUDENT是使用下面的SQL语句创建的 CREATE TABLE STUDENT(SNOC(4)PR1MARY KEY NOTNULL; SNC(8),; SEXC(2),; AGEN(2)CHECK(AGE>15AND AGE<30) 下面的SQI语句中可以正确执行的是 ______。A.INSERT INTO STUDENT(SNO,SEX,AGE)valueS("S9","男",17)B.INSERT INTO STUDENT(SNO,SEX,AGE)valueS(“李安琦”,“男”,20)C.INSERT INTO STUDENT(SEX,AGE)valueS(“男”,20)D.INSERT INTO STUDENT(SNO,SN)valueS("S9",“安琦”,16)
建立一个学生信息表student,要求它由学号sno、姓名sname、性别sex、年龄age4个属性组成,其学号属性唯一,学号、姓名字段不能为空。下列语句正确的是A.CREATE TABLE student(sno char(5) NOT NULL sname char(8) NOT NULL sex char(1) age int);B.CREATE TABLE student (sno char(5) NOT NULL UNIQUE sname char(8) sex char(1) age int);C.CREATE TABLE (sno char(5) NOT NULL UNIQUE sname char(8) NOT NULL sex char(1) age int);D.CREATE TABLE student (sno char(5) NOT NULL UNIQUE sname char(8) NOT NULL sex char(1) age int);
检索所有比“王华”年龄大的学生姓名、年龄和性别。正确的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
建立一个学生信息表student,要求它由学号sno,姓名sname,性别sex,年龄age,4个属性组成,其学号属性惟一,学号、姓名字段不能为空。下列语句正确的是A.CREATE TABLE student (sno char(5)NOT NULL sname char(8)NOT NULL sex char age int);B.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8) sex char age int);C.CREATE TABLE (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);D.CREATE TABLE student (sno char(5)NOT NULL UNIQUE sname char(8)NOT NULL sex char age int);
用SQL语言定义下列学生关系模式:S(SNO,SNAME,SEX,AGE,CLASS_ID)假设规定学生年龄在16-25岁之间,学号(SNO),姓名(SNAME)非空,性别属性域是{男,女},CLASS_ID为班号。试用SQL语言定义这些完整性约束。
享受政府职业培训补贴人员的年龄范围是()。A、有劳动能力和就业创业愿望,男性年龄在16周岁到60周岁之间,女性年龄在16周岁到50周岁之间B、有劳动能力和就业创业愿望,男性年龄在16周岁到55周岁之间,女性年龄在16周岁到55周岁之间C、有劳动能力和就业创业愿望,男性年龄在16周岁到60周岁之间,女性年龄在16周岁到55周岁之间D、有劳动能力和就业创业愿望,男性年龄在16周岁到55周岁之间,女性年龄在16周岁到50周岁之间
数据库中有一张表名称为Student,有列Name,Age,IDCard,Sex。要求写SQL语句查询出表中所有的数据,下列哪个SQL语句是正确的()A、Select* From StudentB、Select Name From StudentC、Select Name,Age,IDCard From StudentD、Select Name,Age,IDCard,Sex From Student
下面If语句统计满足性别为男、职称为副教授以上、年龄小于40岁条件的人数,不正语句是()。A、If sex="男"And age<40 And (duty="教授"Or duty="副教授")Then n=n+1B、If sex="男"And age<40 And InStr(duty,"教授")>0Then n=n+1C、If sex="男"And age<40 And Right(duty,2)="教授"Then n=n+1D、If sex="男"And age<40 And duty="教授"And duty="副教授"Then n=n+1
现有三个表即学生表S、课程表C和学生选课表SC,它们的结构如下: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 SWHE RESN=“王华”B、SELECT SN,AGE,SEX FROM SWHE REAGE>(SELECTAGEFROMSWHERESN=“王华”)C、SELECT SN,AGE,SEX FROM SWHE REAGE>(SELECTAGEWHERESN=“王华”)D、SELECT SN,AGE,SEX FROM SWHE REAGE>王华.AGE
对于学生信息表(XSB),包含字段:学号(SNO),姓名(SNAME),性别(SEX),年龄(AGE),所在系(DEPT),其中SNO为主码,检索年龄在20~30之间的学生姓名和年龄,正确的语句是()A、select sname,age from xsb where age20and age23B、select*from xsb where age between20 and 23C、select sname,age from xsb where agebetween20 and 23
下面If语句统计满足性别为男、职称为副教授以上、年龄小于40岁条件的人数,不正确的语句是()。A、If sex=“男”And age<40 And InStr(duty,“教授”)>0 Then n=n+1B、If sex=“男”And age<40 And(duty=“教授”Or duty=“副教授”)Then n=n+1C、If sex=“男”And age<40 And Right(duty,2)=“教授”Then n=n+1D、If sex=“男”And age<40 And duty=“教授”And duty=“副教授”Then n=n+1
学生表S、课程表C和学生选课表SC,它们的结构如下:S(S_NO,SN,SEX,AGE,DEPT) C(C_NO,CN) SC(S_NO,C_NO,GRADE)其中:S_NO为学号,SN为姓名,SEX为性别,AGE为年龄,DEPT为系别,C_NO为课程号,CN为课程名,GRADE为成绩检索所有比“王华”年龄大的学生姓名、年龄和性别正确的SELECT语句是()A、SELECTSN,AGE, SEX FROM SWHERE AGE>(SELECTAGE FROM S WHERE SN=’王华’)B、SELECTSN,AGE, SEX FROM SC、SELECTSN,AGE,SEX FROM SD、SELECTSN,AGE,SEXFROMS
单选题下面If语句统计满足性别为男、职称为副教授以上、年龄小于40岁条件的人数,不正语句是()。AIf sex=男And age<40 And (duty=教授Or duty=副教授)Then n=n+1BIf sex=男And age<40 And InStr(duty,教授)>0Then n=n+1CIf sex=男And age<40 And Right(duty,2)=教授Then n=n+1DIf sex=男And age<40 And duty=教授And duty=副教授Then n=n+1
单选题若有以下定义:struct tt{char name[10];char sex;} aa={aaaa,'F'},*p=aa;则错误的语句是( )。Ascanf(%c,aa.sex);Baa.sex=getchar();Cprintf(%c,(*p).sex);Dprintf(%c,p-sex);
单选题下面If语句统计满足性别为男、职称为副教授以上、年龄小于40岁条件的人数,不正确的语句是()。AIf sex=“男”And age<40 And InStr(duty,“教授”)>0 Then n=n+1BIf sex=“男”And age<40 And(duty=“教授”Or duty=“副教授”)Then n=n+1CIf sex=“男”And age<40 And Right(duty,2)=“教授”Then n=n+1DIf sex=“男”And age<40 And duty=“教授”And duty=“副教授”Then n=n+1