The EMP table contains these columns: EMPLOYEE_ID NUMBER(4) EMPNAME VARCHAR2 (25) SALARY NUMBER(9,2) HIRE_DATE DATE You query the database with this SQL statement: SELECT empname,hire_date HIREDATE, salary FROM EMP ORDER BY hire_date; How will the results

题目

The EMP table contains these columns: EMPLOYEE_ID NUMBER(4) EMPNAME VARCHAR2 (25) SALARY NUMBER(9,2) HIRE_DATE DATE You query the database with this SQL statement: SELECT empname,hire_date HIREDATE, salary FROM EMP ORDER 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
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

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

第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 EMPLOYEES table contains these columns:LAST_NAME VARCHAR2 (25)SALARY NUMBER (6,2)COMMISSION_PCT NUMBER (6)You need to write a query that will produce these results:1. Display the salary multiplied by the commission_pct.2. Exclude employees with a zero commission_pct.3. Display a zero for employees with a null commission value. Evaluate the SQL statement:SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEESWHERE COMMISSION_PCT IS NOT NULL;What does the statement provide? ()

A. All of the desired results

B. Two of the desired results

C. One of the desired results

D. An error statement


参考答案:C

第4题:

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

第5题:

The EMPLOYEES table contains these columns: LAST_NAME VARCHAR2 (25) SALARY NUMBER (6,2) COMMISSION_PCT NUMBER (6) You need to write a query that will produce these results: 1. Display the salary multiplied by the commission_pct. 2. Exclude employees with a zero commission_pct. 3. Display a zero for employees with a null commission value. Evaluate the SQL statement: SELECT LAST_NAME, SALARY*COMMISSION_PCT FROM EMPLOYEES WHERE COMMISSION_PCT IS NOT NULL; What does the statement provide? ()

  • A、All of the desired results
  • B、Two of the desired results
  • C、One of the desired results
  • D、An error statement

正确答案:C

第6题:

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

  • A、INSERT INTO employees (employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01/01/01);
  • B、INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01 january 01');
  • C、INSERT INTO employees(employee_id, first_name, last_name, Hire_date) VALUES (1000, 'John', 'smith', To_ date ('01/01/01));
  • D、INSERT INTO employees(employee_id, first_name, last_name, hire_date) VALUES (1000, 'John', 'smith','01-Jan-01');

正确答案:A

第7题:

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

第8题:

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

第9题:

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

第10题:

The EMP table contains these columns: LAST NAME VARCHAR2(25) SALARY NUMBER(6,2) DEPARTMENT_ID NUMBER(6) You need to display the employees who have not been assigned to any department. You write the SELECT statement: SELECT LAST_NAME, SALARY, DEPARTMENT_ID FROM EMP WHERE DEPARMENT_ID = NULL; 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

更多相关问题