itgle.com

如何实现文章表news,id字段值为5记录的点击数字段num自增()。A、Update news set num=num+1;B、Update news set num=num+1 where id==5C、Update news set num=num++ where id=5D、Update news set num=num+1 where id=5

题目

如何实现文章表news,id字段值为5记录的点击数字段num自增()。

  • A、Update news set num=num+1;
  • B、Update news set num=num+1 where id==5
  • C、Update news set num=num++ where id=5
  • D、Update news set num=num+1 where id=5

相似考题
更多“如何实现文章表news,id字段值为5记录的点击数字段num自增()。A、Update news set num=num+1;B、Update news set num=num+1 where id==5C、Update news set num=num++ where id=5D、Update news set num=num+1 where id=5”相关问题
  • 第1题:

    Examine the structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER NOT NULLEMP_NAME VARCHAR2(30)JOB_ID VARCHAR2(20) DEFAULT ‘SA_REP‘SAL NUMBERCOMM_PCT NUMBERMGR_ID NUMBERDEPARTMENT_ID NUMBERYou need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below:JOB_ID: Default value specified for this column definition.SAL: Maximum salary earned for the job ID SA_REP.COMM_PCT: Default value specified for this commission percentage column, if any. If no default value is specified for the column, the value should be NULL. DEPARTMENT_ID: Supplied by the user during run time through substitution variable.Which UPDATE statement meets the requirements?()

    A. UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = ‘SA_REP‘) AND comm_pct = DEFAULT AND department_id = &did WHERE employee _id IN (103,115);

    B. UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job _ id = ‘SA_ REP‘;

    C. UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = ‘SA_REP‘), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);

    D. UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job _ id = ‘SA_ REP‘;

    E. UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = ‘SA_REP‘) comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);


    参考答案:C

  • 第2题:

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

    A.REPLACE AGE WITH AGE+1

    B.UPDATE STUDENT AGE WITH AGE+1

    C.UPDATE SET AGE WITH AGE+I

    D.UPDATE STUDENT SET AGE=AGE+1


    正确答案:D
    解析:本题考查SQL语句中UPDATA语句的功能和使用。选项A的错误在于,它是普通的修改命令,在缺少短语ALL情况下,只能修改当前的记录;选项B的错误在于不应该使用 WITH短语;选项C则没有指明对STUDENT表进行操作,并且不应该使用短语WITH;选项D是实现题目要求的正确书写方法,故选项D为正确答案。

  • 第3题:

    使用如下数据表:仓库表(仓库号,所在城市) 职工表(职工号,仓库号,工资) 其中,仓库号、所在城市和职工号字段为字符型,工资字段为数值型。 将仓库号为A4的职工的工资改为2000.O0,正确的命令是( )。

    A. UPDATE职工表SET工资WITH 2000.00 WHERE仓库号=”A4”

    B. UPDATE职工表SET工资=2000.OO WHERE仓库号=”A4”

    C. UPDATE FROM职工表SET工资wITH 2000.OO WHERE仓库号=”A4”

    D. UPDATE FROM职工表SET工资=2000.OO WHERE仓库号=”A4”


    正确答案:B
    UPDATE命令的格式为:UPDATE数据表名SET列名1=表达式1[,列名2=表达式2…]WHERE筛选条件。

  • 第4题:

    ( 35 )将学号为 “ 02080110 ” 、课程号为 “ 102 ” 的选课记录的成绩改为 92 ,正确的 SQL 语句是

    A ) UPDATE 选课 SET 成绩 WITH 92 WHERE 学号 = "02080110" AND 课程号 = "102"

    B ) UPDATE 选课 SET 成绩 =92 WHERE 学号 = "02080110" AND 课程号 = "102"

    C ) UPDATE FROM 选课 SET 成绩 WITH 92 WHERE 学号 = "02080110" AND 课程号 = "102"

    D ) UPDATE FROM 选课 SET 成绩 =92 WHERE 学号 = "02080110" AND 课程号 = "102"


    正确答案:B

  • 第5题:

    将表Teacher中职称字段为"助教"人员改为"讲师",应为()

    • A、UPDATE Teacher SET职称="助教"WHERE职称="讲师"
    • B、UPDATE Teacher SET职称="讲师"WHERE职称="助教"
    • C、UPDATE SET职称="助教"WHERE职称="讲师"FROMTeacher
    • D、UPDATE SET职称="讲师"WHERE职称="助教"FROMTeacher

    正确答案:B

  • 第6题:

    下列MySQL命令中,可以实现更新记录的命令有()。

    • A、update 数据表参照关系 set 字段名称=值, [where 条件] [group by 字段名称]
    • B、update 数据表,数据表, set 字段名称=值,where 条件
    • C、update 数据表 set 字段名称=值,[where 条件]
    • D、update 数据表 set 字段名称=值, [where 条件] [order by 字段名称]

    正确答案:C

  • 第7题:

    要在tbAddress表中更新记录,下面()语句是正确的。

    • A、Update tbAddress Set strName="萌萌",intAge=22 Where ID=2
    • B、Update tbAddress Set strName=萌萌,intAge=22 Where strName=萌萌
    • C、Update tbAddress Set dtmSubmit=2008-10-1 Where strName="萌萌"
    • D、Update tbAddress Set intAge=18

    正确答案:A,D

  • 第8题:

    使用()语句,将Account表内的性别字段内容,全部都改为“男”。

    • A、Update account SET Sex=´女´where Sex=´男´
    • B、Update account SET Sex=´男´where Sex=´女´
    • C、Update FROM account SET Sex=´女´where Sex=´男´
    • D、Update FROM account SET Sex=´男´where Sex=´女´

    正确答案:B

  • 第9题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) DEFAULT 'SA_REP' SAL NUMBER COMM_PCT NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below: JOB_ID: Default value specified for this column definition. SAL: Maximum salary earned for the job ID SA_REP. COMM_PCT: Default value specified for this commission percentage column, if any. If no default value is specified for the column, the value should be NULL. DEPARTMENT_ID: Supplied by the user during run time through substitution variable. Which UPDATE statement meets the requirements?()

    • A、UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') AND comm_pct = DEFAULT AND department_id = &did WHERE employee_id IN (103,115);
    • B、UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';
    • C、UPDATE employeesC.UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);
    • D、UPDATE employeesD.UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';
    • E、UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);

    正确答案:C

  • 第10题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) DEFAULT 'SA_REP' SAL NUMBER COMM_PCT NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below: JOB_ID: Default value specified for this column definition. SAL: Maximum salary earned for the job ID SA_REP. COMM_PCT: Default value specified for this commission percentage column, if any. If no default value is specified for the column, the value should be NULL. DEPARTMENT_ID: Supplied by the user during run time through substitution variable. Which UPDATE statement meets the requirements?()

    • A、UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') AND comm_pct = DEFAULT AND department_id = &did WHERE employee _id IN (103,115);
    • B、UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job _ id = 'SA_ REP';
    • C、UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);
    • D、UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job _ id = 'SA_ REP';
    • E、UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);

    正确答案:C

  • 第11题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE Which UPDATE statement is valid?()
    A

    UPDATE employees SET first_name = 'John' SET last_name = 'Smith' WHERE employee_id = 180;

    B

    UPDATE employees SET first_name = 'John', SET last_name = 'Smoth' WHERE employee_id = 180;

    C

    UPDATE employee SET first_name = 'John' AND last_name = 'Smith' WHERE employee_id = 180;

    D

    UPDATE employee SET first_name = 'John', last_name = 'Smith' WHERE employee_id = 180;


    正确答案: C
    解析: 暂无解析

  • 第12题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) DEFAULT 'SA_REP' SAL NUMBER COMM_PCT NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below: JOB_ID: Default value specified for this column definition. SAL: Maximum salary earned for the job ID SA_REP. COMM_PCT: Default value specified for this commission percentage column, if any. If no default value is specified for the column, the value should be NULL. DEPARTMENT_ID: Supplied by the user during run time through substitution variable. Which UPDATE statement meets the requirements?()
    A

    UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') AND comm_pct = DEFAULT AND department_id = &did WHERE employee _id IN (103,115);

    B

    UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job _ id = 'SA_ REP';

    C

    UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);

    D

    UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job _ id = 'SA_ REP';

    E

    UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);


    正确答案: C
    解析: 暂无解析

  • 第13题:

    在下列所给的操作中,哪个操作能被执行

    A.UPDATE部门SET部门号=′05′WHERE部门名=′财务部′

    B.UPDATE部门SET部门号=′05′WHERE部门名=′服务部′

    C.UPDATE雇员SET工资=600 WHERE雇员号=′010′

    D.UPDATE雇员SET部门号=′05′WHERE雇员号=′101′


    正确答案:B
    解析:级联删除和级联更新是两个表中的相关数据,可同时删除和更新,否则,牵涉两表的内容不能删除和更新。选项A:条件中部门名为“财务部”的部门号“01”涉及另一个表雇员,所以不能执行。选项B,“服务部”对应的部门号为“03”,在雇员中没有此字段的内容,所以可以更新。选项 C,雇员号为“01”,对应部门号为“01”,在部门表中也有此记录,所以不能更新,同理选项D也不能执行。

  • 第14题:

    若要使所有学科80分以上的成绩都增加5%, 80至60分的成绩都增加10%,应如何更新数据库( )。 A.UPDATE SC SET GRADE=GRADE*1.05 WHERE SC.GRADE>=80 UPDATE SC SET GRADE=GRADE* 1.10 WHERE SC.GRADE>=60 AND SC.GRADE <=80 B.UPDATE SC SET GRADE=GRADE* 1.10 WHERE SC.GRADE>=60 AND SC.GRADE<=80 UPDATE SC SET GRADE=GRADE* 1.05 WHERE SC.GRADE>=80 C.UPDATE SC SET GRADE=GRADE* 1.05 WIRE SC.GRADE>=80 AND SET GRADE =GRADE* 1.10 WHARE SC.GRADE>=60 D.UPDATE SC SET GRADE=GRADE* 1.10 WHERE SC.GRADE>=60 AND SC.GRADE <=80 AND SET GRADE=GRADE* 1.05 WHERE SC.GRADE>=80


    正确答案:A
    Update 语句用于修改表中的数据,语法:UPDATE 表名称 SET 列名称 = 新值 WHERE 列名称 = 某值,根据语法,表名称应该为SC,GRADE=GRADE*1.05,条件为SC.GRADE>=80,后面的60到80分的同理。

  • 第15题:

    请填写以下Cisco 6500交换机端口配置命令的描述。

    set port name mod_num/port_num[name_string] (1)

    set port level mod—num/port_num noramal I high (2)

    set port speed mod_num/port_num<1011001auto> (3)

    set port duplex mod_num/port_num fullIhalf (4)

    show port mod_num/port_num (5)


    正确答案:(1)设置端口名称 (2)设置端口优先级 (3)设置端口速率 (4)设置端口传输类型 (5)检查端口配置状态
    (1)设置端口名称 (2)设置端口优先级 (3)设置端口速率 (4)设置端口传输类型 (5)检查端口配置状态 解析:此题考查了Cisco 6500交换机端口配置命令的使用。

  • 第16题:

    (18)若要将“产品”表中所有供货商是“ABC”的产品单价下调50,则正确的SQL语句是

    A)UPDATE 产品 SET 单价=50 WHERE 供货商="ABC"

    B)UPDATE 产品 SET 单价=单价-50 WHERE 供货商="ABC"

    C)UPDATE FROM 产品 SET单价=50 WHERE 供货商="ABC"

    D)UPDATE FROM 产品 SET单价=单价-50 WHERE 供货商="ABC"


    正确答案:B

  • 第17题:

    如何使用ORM实现以下查询SQL,SELECT*FROMorderWHEREidBETWE130.如何使用ORM实现以下查询SQL,SELECT*FROMorderWHEREidBETWE,EN20AND100AND(num<=20ornum>=30);()

    • A、Order.objects.filter(id__gt=20,id__lt=100).filter(Q(num<=20)Q.num>=30))
    • B、Order.objects.filter(id__gt=20,id__lt=100).filter(Q(num__lte=20)Q.num__gte=30))
    • C、Order.objects.filter(Q(id__gt=20)&Q(id__lt=100)).filter(Q(num__lte=20)Q.num__gte=30))
    • D、Order.objects.filter(Q(id__gt=20)&&Q(id__lt=100)).filter(Q(num__lte=20)Q.num__gte=30))

    正确答案:C

  • 第18题:

    学生成绩表grade中有字段score(float),现在要把所有在55至60分之间的分数提高5分,以下SQL语句正确的是()。

    • A、Update grade set score=score+5 where score in 55..60
    • B、Update grade set score=score+5 where score >=55 AND score <=60
    • C、Update grade set score=score+5 where score between 55 or 60
    • D、Update grade set score=score+5 where score <=55 and score >=60

    正确答案:B

  • 第19题:

    学生成绩表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

    正确答案:C,D

  • 第20题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE You issue these statements: CREATE table new_emp ( employee_id NUMBER, name VARCHAR2(30)); INSERT INTO new_emp SELECT employee_id , last_name from employees; Savepoint s1; UPDATE new_emp set name = UPPER(name); Savepoint s2; Delete from new_emp; Rollback to s2; Delete from new_emp where employee_id =180; UPDATE new_emp set name = 'James'; Rollback to s2; UPDATE new_emp set name = 'James' WHERE employee_id =180; Rollback; At the end of this transaction, what is true?()

    • A、You have no rows in the table.
    • B、You have an employee with the name of James.
    • C、You cannot roll back to the same savepoint more than once.
    • D、Your last update fails to update any rows because employee ID 180 was already deleted.

    正确答案:A

  • 第21题:

    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE Which UPDATE statement is valid?()

    • A、UPDATE employees SET first_name = 'John' SET last_name ='Smith' WHERE employee_id = 180;
    • B、UPDATE employees SET first_name = 'John', SET last_name ='Smith' WHERE employee_id = 180;
    • C、UPDATE employees SET first_name = 'John' AND last_name ='Smith' WHERE employee_id = 180;
    • D、UPDATE employees SET first_name = 'John', last_name ='Smith' WHERE employee_id = 180;

    正确答案:D

  • 第22题:

    单选题
    如何实现文章表news,id字段值为5记录的点击数字段num自增()。
    A

    Update news set num=num+1;

    B

    Update news set num=num+1 where id==5

    C

    Update news set num=num++ where id=5

    D

    Update news set num=num+1 where id=5


    正确答案: B
    解析: 暂无解析

  • 第23题:

    单选题
    Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER NOT NULL EMP_NAME VARCHAR2(30) JOB_ID VARCHAR2(20) DEFAULT 'SA_REP' SAL NUMBER COMM_PCT NUMBER MGR_ID NUMBER DEPARTMENT_ID NUMBER You need to update the records of employees 103 and 115. The UPDATE statement you specify should update the rows with the values specified below: JOB_ID: Default value specified for this column definition. SAL: Maximum salary earned for the job ID SA_REP. COMM_PCT: Default value specified for this commission percentage column, if any. If no default value is specified for the column, the value should be NULL. DEPARTMENT_ID: Supplied by the user during run time through substitution variable. Which UPDATE statement meets the requirements?()
    A

    UPDATE employees SET job_id = DEFAULT AND Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP') AND comm_pct = DEFAULT AND department_id = &did WHERE employee_id IN (103,115);

    B

    UPDATE employees SET job_id = DEFAULT AND Sal = MAX(sal) AND comm_pct = DEFAULT OR NULL AND department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';

    C

    UPDATE employeesC.UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115);

    D

    UPDATE employeesD.UPDATE employees SET job_id = DEFAULT, Sal = MAX(sal), comm_pct = DEFAULT, department_id = &did WHERE employee_id IN (103,115) AND job_id = 'SA_REP';

    E

    UPDATE employees SET job_id = DEFAULT, Sal = (SELECT MAX(sal) FROM employees WHERE job_id = 'SA_REP'), comm_pct = DEFAULT OR NULL, department_id = &did WHERE employee_id IN (103,115);


    正确答案: D
    解析: 暂无解析