更多“17 ) SQL 中, " AGE IN ( 15 , 35 ) " 短语的正确含义是A ) AGE = 1 5 AND AGE = 35B ) AGE = 1 ”相关问题
  • 第1题:

    根据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

  • 第2题:

    根据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

  • 第3题:

    在Visual FoxPro中,使用SQL命令将学生表STUDENT中的学生年龄AGE字段的值增加1岁,应该的使用命令是( )。

    A. REPLACE AGE WITH AGE+1

    B. MODIFY STUDENT SET AGE=AGE+1

    C. ALTER STUDENT SET AGE WITH AGE+1

    D. UPDATE STUDENT SET AGE=AGE+1


    正确答案:D
    替换可以使用REPLACE和UPDATE命令,其中REPLACE的格式为:
    REPLACE FieldNamel WITH eExpressionl[ADDITIVE] [,FieldName2 WITH eExpression2[ADDITIVE]]...
    [Scope][FOR IExpressionl][WHILE lExpression2]
    [IN nWorkArea I cTableAlias]
    [NOOPTIMIZE]
    UPDATE的格式为:
    UPDATE[DatabaseName1!]TableNamel
    SET Column_Namel=eExpressionl
    [,Column_Name2=eExpression2…]
    WHEREFilterConditionl[ AND|OR FiherCondition2…]]
    但REPLACE不是SQL语句,故本题A不是正确答案,正确答案是D。

  • 第4题:

    根据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

  • 第5题:

    如果学生表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<25)) 下面的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)


    正确答案:B
    由于SN0项不可以为空,是必填字段,在用INSERT插入记录时,SN0字段的值不可省,故A、c不正确,在用INSERT插入记录时,D项中的年龄不符合约束条件,故D不正确。
    INSERT语句的格式为:
    INSERT INTO dbf__name[(fnamel[,fname2,...])]VALUES(eExpressionl[,eExpression2,...j)
    PRIMARY KEY NOT NULL用来定义SN0为主关键字,并且不可为NULL值;
    CHECK(ACE>15 AND AGE<25)语句用来约束字段 AGE必须大于l5并且小于25。