单项选择题

Evaluate these two SQL statements:
SELECT last_name, salary , hire_date
FROM EMPLOYEES
ORDER BY salary DESC;
SELECT last_name, salary , hire_date
FROM EMPLOYEES
ORDER BY 2 DESC;
What is true about them?()

A.The two statements produce identical results.
B.The second statement returns a syntax error.
C.There is no need to specify DESC because the results are sorted in descending order by default.
D.The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题What are two reasons to create synonyms? ()

A.You have too many tables.
B.Your tables are too long.
C.Your tables have difficult names.
D.You want to work on your own tables.
E.You want to use another schema's tables.
F.You have too many columns in your tables.

2.单项选择题What is necessary for your query on an existing view to execute successfully?()

A.The underlying tables must have data.
B.You need SELECT privileges on the view.
C.The underlying tables must be in the same schema.
D.You need SELECT privileges only on the underlying tables.

3.单项选择题You need to create a view EMP_VU. The view should allow the users tomanipulate the records of only the employees that are working for departments 10 or 20. Which SQL statement would you use to create the view EMP_VU?()

A.CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20);
B.CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH READ ONLY;
C.CREATE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) WITH CHECK OPTION;
D.CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20);
E.CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;

4.单项选择题

Evaluate this SQL statement:
SELECT e.employee_id, (.15* e.salary) + (.5 * e.commission_pct)
+ (s.sales_amount * (.35 * e.bonus)) AS CALC_VALUE
FROM employees e, sales s
WHERE 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.

5.单项选择题

Click the Exhibit button to examine the structures of the EMPLOYEES and TAX tables.
You need to find the percentage tax applicable for each employee. Which SQL statement would you use?()

A.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t ON e.salary BETWEEN t.min_salary AND t.max_salary;
B.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t WHERE e.salary > t.min_salary AND < t.max_salary;
C.SELECT employee_id, salary, tax_percent FROM employees e JOIN tax t ON (MIN(e.salary) = t.min_salary AND MAX(e.salary) = t.max_salary);
D.You cannot find the information because there is no common column between the two tables.

6.单项选择题

Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables.
You want to retrieve all employees' last names, along with their managers' last names and their department names. Which query would you use?()

A.SELECT last_name, manager_id, department_name FROM employees e FULL OUTER JOIN departments d ON (e.department_id = d.department_id);
B.SELECT e.last_name, m.last_name, department_name FROM employees e LEFT OUTER JOIN employees m on ( e.manager_id = m.employee_id) LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);
C.SELECT e.last_name, m.last_name, department_name FROM employees e RIGHT OUTER JOIN employees m on ( e.manager_id = m.employee_id) LEFT OUTER JOIN departments d ON (e.department_id = d.department_id); 
D.SELECT e.last_name, m.last_name, department_name FROM employees e LEFT OUTER JOIN employees m on ( e.manager_id = m.employee_id) RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);
E.SELECT e.last_name, m.last_name, department_name FROM employees e RIGHT OUTER JOIN employees m on ( e.manager_id = m.employee_id) RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);
F.SELECT last_name, manager_id, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id) ;

7.单项选择题

Click the Exhibit button to examine the structures of the EMPLOYEES, DEPARTMENTS, and TAX tables.
For which situation would you use a nonequijoin query?()

A.to find the tax percentage for each of the employees
B.to list the name, job_id, and manager name for all the employees
C.to find the name, salary, and the department name of employees who are not working with Smith
D.to find the number of employees working for the Administrative department and earning less than 4000
E.to display name, salary, manager ID, and department name of all the employees, even if the employees do not have a department ID assigned

8.单项选择题

You need to create a table named ORDERS that contains four columns:
1.an ORDER_ID column of number data type
2.a CUSTOMER_ID column of number data type
3.an ORDER_STATUS column that contains a character data type
4.a DATE_ORDERED column to contain the date the order was placed
When a row is inserted into the table, if no value is provided for the status of the order, the value PENDING should be used instead.
Which statement accomplishes this?()

A.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status NUMBER(10) DEFAULT 'PENDING', date_ordered DATE );
B.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
C.CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
D.CREATE OR REPLACE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) = 'PENDING', date_ordered DATE );
E.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered DATE );
F.CREATE TABLE orders ( order_id NUMBER(10), customer_id NUMBER(8), order_status VARCHAR2(10) DEFAULT 'PENDING', date_ordered VARCHAR2 );

10.单项选择题

You own a table called EMPLOYEES with this table structure:
EMPLOYEE_ID NUMBER Primary Key
FIRST_NAME VARCHAR2(25)
LAST_NAME VARCHAR2(25)
HIRE_DATE DATE
What happens when you execute this DELETE statement?
DELETE employees;()

A.You get an error because of a primary key violation.
B.The data and structure of the EMPLOYEES table are deleted.
C.The data in the EMPLOYEES table is deleted but not the structure.
D.You get an error because the statement is not syntactically correct.