单选题The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()A SELECT E

题目
单选题
The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()
A

SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;

B

SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;

C

SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;

D

SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5;

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

The EMP table contains these columns:You need to display the employees who have not been assigned to any department.You write the SELECT statement:What is true about this SQL statement?()

A. The SQL statement displays the desired results.

B. The column in the WHERE clause should be changed to display the desired results.

C. The operator in the WHERE clause should be changed to display the desired results.

D. The WHERE clause should be changed to use an outer join to display the desired results.


参考答案:C

第2题:

The EMPLOYEES table has these columns: LAST NAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants to add a default value to the SALARY column. You plan to alter the table by using this SQL statement: ALTER TABLE EMPLOYEES MODIFY ( SALARY DEFAULT 5000); What is true about your ALTER statement?()

  • A、Column definitions cannot be altered to add DEFAULT values.
  • B、A change to the DEFAULT value affects only subsequent insertions to the table.
  • C、Column definitions cannot be altered at add DEFAULT values for columns with a NUMBER data type.
  • D、All the rows that have a NULL value for the SALARY column will be updated with the value 5000.

正确答案:B

第3题:

The EMP table has these columns:ENAME VARCHAR2(35)SALARY NUMBER(8,2)HIRE_DATE DATEManagement wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()

A. SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;

B. SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;

C. SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;

D. SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5;


参考答案:C

第4题:

The PRODUCTS table has these columns: PRODUCT_ID NUMBER(4) PRODUCT_NAME VARCHAR2(45) PRICE NUMBER(8,2) Evaluate this SQL statement: SELECT * FROM PRODUCTS ORDER BY price, product _ name; What is true about the SQL statement?()

  • A、The results are not sorted.
  • B、The results are sorted numerically.
  • C、The results are sorted alphabetically.
  • D、The results are sorted numerically and then alphabetically.

正确答案:D

第5题:

Management has asked you to calculate the value 12*salary* commission_pct for all the employees in the EMP table. The EMP table contains these columns: LAST NAME VARCNAR2(35) NOT NULL SALARY NUMBER(9,2) NOT NULL COMMISION_PCT NUMBER(4,2) Which statement ensures that a value is displayed in the calculated columns for all employees?()

  • A、SELECT last_name, 12*salary* commission_pct FROM emp;
  • B、SELECT last_name, 12*salary* (commission_pct,0) FROM emp;
  • C、SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;
  • D、SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;

正确答案:C

第6题:

The EMP table contains these columns:EMPLOYEE_ID NUMBER(4)EMPNAME VARCHAR2 (25)SALARY NUMBER(9,2)HIRE_DATE DATEYou query the database with this SQL statement:SELECT empname,hire_date HIREDATE, salaryFROM EMPORDER BY hire_date;How will the results be sorted?()

A.randomly

B.ascending by date

C.descending by date

D.ascending alphabetically

E.descending alphabetically


参考答案:B

第7题:

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

第8题:

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

第9题:

You need to display the last names of those employees who have the letter "A" as the second character in their names. Which SQL statement displays the required results? ()

  • A、SELECT last_name FROM EMP WHERE last_ name LIKE '_A%';
  • B、SELECT last_name FROM EMP WHERE last name ='*A%'
  • C、SELECT last_name FROM EMP WHERE last name ='_A%';
  • D、SELECT last_name FROM EMP WHERE last name LIKE '*A%'

正确答案:A

第10题:

The EMP table has these columns: ENAME VARCHAR2(35) SALARY NUMBER(8,2) HIRE_DATE DATE Management wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()

  • A、SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;
  • B、SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;
  • C、SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;
  • D、SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5;

正确答案:C

更多相关问题