The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(5,2)You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero

题目

The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(5,2)You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column.Which SQL statement displays the desired results? ()

A. SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;

B. SELECT last_name, (salary * 12) * IFNULL(commission_pct, 0) FROM EMPLOYEES;

C. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;

D. SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;


相似考题
参考答案和解析
参考答案:D
更多“The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_P ”相关问题
  • 第1题:

    阅读以下说明C++代码,将应填入(n)处的字句写在对应栏内。

    [说明]

    本程序实现了雇员信息管理功能,其中封装了雇员信息及其设置、修改、删除操作。已知当输入为“Smith 31 2960.0”时,程序的输出是:

    姓名:Smith 年龄:31 工资:2960

    姓名:Smith 年龄:31 工资:3500

    姓名:Mary 年龄:23 工资:2500

    [C++程序]

    include <iostream.h>

    include <string.h>

    class employee{

    char *name; //雇员姓名

    short age; //年龄

    float salary;//工资

    public:

    employee();

    void set_name(char *);

    void set_age(short a) {age=a;}

    void set_salary(float s) {salary=s;}

    (1);

    ~ employee(){delete[] name;}

    };

    employee::employee() { name="";

    age=0;

    salary=0.0;

    void employee::set_name(char *n)

    { name=new char[strlen(n)+1];

    (2) (name,n);

    }

    void employee::print()

    { cout<<"姓名":"<<name<<" 年龄:"<<agc<<" 工资:" <<salary<<endl;

    }

    void main()

    { char *na;

    short ag=0;

    float sa=0;

    (3);

    na=new char[10];

    cin>>na>>ag>>sa;

    emp.set_name(na);

    emp.set_age(ag);

    emp.set_salary(sa);

    emp.print();

    (4) (3500.0);

    emp.print();

    (5);

    emp.set_name("Mary");

    emp.set_age(23);

    emp.set_salary(2500.0);

    emp.print();

    }


    正确答案:(1) void print() (2) strcpy (3) employee emp (4) emp.set_salary (5)emp.~employee()
    (1) void print() (2) strcpy (3) employee emp (4) emp.set_salary (5)emp.~employee() 解析:程序定义了一个employee类,它包含了一个雇员的档案数据,及对这些数据的若干处理函数:构造函数employee创建一个雇员空档案;set_name(),set_age ()和set_salary()分别用来为雇员档案填入姓名、年龄和工资;print()函数的功能是输出该雇员的档案内容;析构函数~employee()的功能是当某雇员档案撤销或改成另一姓名时,释放原数据占用的空。
    (1)此处应声明print函数;
    (2)此处应调用字符申拷贝函数,以更改name属性的值;
    (3)此处显然应声明emp变量;
    (4)~(5):由程序的输出可知(4)处重新设置了emp变量salary属性的值,(5)处则应调用析构函数.

  • 第2题:

    Click the Exhibit button to examine the data of the EMPLOYEES table. Evaluate this SQL statement:SELECT e.employee_id "Emp_id", e.emp_name "Employee", e.salary, m.employee_id "Mgr_id", m.emp_name "Manager"FROM employees e JOIN employees m ON (e.mgr_id = m.employee_id)AND e.salary > 4000;What is its output?()

    A.A

    B.B

    C.C

    D.D

    E.E


    参考答案:A

  • 第3题:

    Click the Exhibit button to examine the data of the EMPLOYEES table.Which statement lists the ID, name, and salary of the employee, and the ID and name of the employee‘s manager, for all the employees who have a manager and earn more than 4000?()

    A.SELECT employee_id "Emp_id", emp_name "Employee", salary, employee_id "Mgr_id", emp_name "Manager" FROM employees WHERE salary > 4000;

    B.SELECT e.employee_id "Emp_id", e.emp_name "Employee", e.salary, m.employee_id "Mgr_id", m.emp_name "Manager" FROM employees e JOIN employees m WHERE e.mgr_id = m.mgr_id AND e.salary > 4000;

    C.SELECT e.employee_id "Emp_id", e.emp_name "Employee", e.salary, m.employee_id "Mgr_id", m.emp_name "Manager" FROM employees e JOIN employees m ON (e.mgr_id = m.employee_id) AND e.salary > 4000;

    D.SELECT e.employee_id "Emp_id", e.emp_name "Employee", e.salary, m.mgr_id "Mgr_id", m.emp_name "Manager" FROM employees e SELF JOIN employees m WHERE e.mgr_id = m.employee_id AND e.salary > 4000;

    E.SELECT e.employee_id "Emp_id", e.emp_name "Employee", e.salary, m.mgr_id "Mgr_id" m.emp_name "Manager" FROM employees e JOIN employees m USING (e.employee_id = m.employee_id) AND e.salary > 4000;


    参考答案:C

  • 第4题:

    回收用户U1,U2和U3在关系employee的salary属性上的UPDATE权限的语句是【 】UPDATE(salary) ON employee FROM Ul,U2,U3。


    正确答案:REVOKE
    REVOKE 解析:回收用户U1,U2和U3在关系employee的salary属性上的UPDATE权限的语句是:REVOKE UPDATE(salary)ON employee FROM U1,U2,U3。

  • 第5题:

    Evaluate this SQL statement:e.employee_id, (.15* e.salary) + (.5 * e.commission_pct)+ (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUEFROM employees e, sales sWHERE e.employee_id = s.emp_id;What will happen if you remove all the parentheses from the calculation?()

    A.The value displayed in the CALC_VALUE column will be lower.

    B.The value displayed in the CALC_VALUE column will be higher.

    C.There will be no difference in the value displayed in the CALC_VALUE column.

    D.An error will be reported.


    参考答案:C