首页计算机考试Oracle认证
(单选题)

对于雇员表(EMP)中的员工薪水(SAL)进行分级,3000元以上的为A级,2000元以上到3000元为B级,2000元及以下为C级,以下哪此操作能实现以上要求()

Aselect sal,decode(sal>3000,'A',sal>2000,'B','C') grade from emp;

Bselect sal,decode(sal,3000,'A',2000,'B','C') grade from emp;

Cselect sal,(case when sal>3000 then 'A' when sal>2000 then 'B' else 'C' end) grade from emp;

Dselect sal,(if sal>3000 then 'A' elsif sal>2000 then 'B' else 'C' end if) grade from emp;

正确答案

来源:www.examk.com

答案解析

相似试题

  • (单选题)

    emp表是雇员信息表,sal字段存放是的雇员的月薪,以下哪个变量可以存放sal类型的值()

    答案解析

  • (单选题)

    在PL/SQL中定义一个可以存放雇员表(EMP)的员工名称(ENAME)的PL/SQL表类型,应该()

    答案解析

  • (单选题)

    emp表是雇员信息表,以下哪个变量可以存放emp表中的一条记录()

    答案解析

  • (单选题)

    对于以下SQL语句说法正确的是() SELECT ename FROM emp WHERE sal IN (SELECT MAX(sal) FROM emp GROUP BY deptno);

    答案解析

  • (单选题)

    授予sa用户在SCOTT.EMP表中SAL列的更新权限的语句是()。

    答案解析

  • (单选题)

    Examine the following commands and their output: SQL> SELECT ename, sal FROM emp WHERE ename='JAMES'; ENAME SAL JAMES 1050 QL> UPDATE emp SET sal=sal+sal*1.2 WHERE ename='JAMES'; 1 row updated. SQL> SELECT ename, sal FROM emp WHERE ename='JAMES'; ENAME SAL JAMES 2310 View the exhibit and examine the Flashback Version Query that was executed after the preceding commands. What could be the possible cause for the query not displaying any row?()

    答案解析

  • (单选题)

    Evaluate this SQL statement: SELECT ename, sal, 12*sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"?()

    答案解析

  • (单选题)

    Evaluate this SQL statement: SELECT ename, sal, 12* sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? ()

    答案解析

  • (单选题)

    Evaluate this SQL statement: SELECT ename, sal, 12* sal+100 FROM emp; The SAL column stores the monthly salary of the employee. Which change must be made to the above syntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"?()

    答案解析

快考试在线搜题