单项选择题

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) ;


您可能感兴趣的试卷

你可能感兴趣的试题

1.单项选择题

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

2.单项选择题

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 );

4.单项选择题

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.

6.单项选择题Which statement adds a constraint that ensures the CUSTOMER_NAME column of the CUSTOMERS table holds a value?()

A.ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
B.ALTER TABLE customers MODIFY CONSTRAINT cust_name_nn CHECK customer_name IS NOT NULL;
C.ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn NOT NULL;
D.ALTER TABLE customers MODIFY customer_name CONSTRAINT cust_name_nn IS NOT NULL;
E.ALTER TABLE customers MODIFY name CONSTRAINT cust_name_nn NOT NULL;
F.ALTER TABLE customers ADD CONSTRAINT cust_name_nn CHECK customer_name NOT NULL;

7.多项选择题

Click the Exhibit button and examine the data from the EMP table.
The COMMISSION column shows the monthly commission earned by the employee.
Which two tasks would require subqueries or joins in order to be performed in a single step? ()

A.listing the employees who earn the same amount of commission as employee 3
B.finding the total commission earned by the employees in department 10
C.finding the number of employees who earn a commission that is higher than the average commission of the company
D.listing the departments whose average commission is more than 600
E.listing the employees who do not earn commission and who are working for department 20 in descending order of the employee ID
F.listing the employees whose annual commission is more than 6000

8.多项选择题Which two statements are true regarding the default behavior of the ORDER BY clause? ()

A.Null values are left out of the sort.
B.Character values are displayed from Z to A
C.Date values are displayed with the earliest value first.
D.Null values are displayed last for descending sequences.
E.Numeric values are displayed with the lowest values first.

9.多项选择题Which are DML statements? ()

A.COMMIT
B.MERGE
C.UPDATE
D.DELETE
E.CREATE
F.DROP...

10.单项选择题

Click the Exhibit button and examine the data in the EMPLOYEES table.
Examine the subquery:
SELECT last_name
FROM employees
WHERE salary IN (SELECT MAX(salary)
FROM employees
GROUP BY department_id);
Which statement is true?()

A.The SELECT statement is syntactically accurate.
B.The SELECT statement does not work because there is no HAVING clause.
C.The SELECT statement does not work because the column specified in the GROUP BY clause is not in the SELECT list.
D.The SELECT statement does not work because the GROUP BY clause should be in the main query and not in the subquery.

最新试题

Which is an iSQL*Plus command? ()

题型:单项选择题

Which object privileges can be granted on a view? ()

题型:单项选择题

Examine the structure of the EMPLOYEES table:EMPLOYEE_ID NUMBER NOT NULL, Primary KeyEMP_NAME VARCHAR2(30)JOB_ID NUMBER\SAL NUMBERMGR_ID NUMBER References EMPLOYEE_ID columnDEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table You created a sequence called EMP_ID_SEQ inorderto populate sequential values for the EMPLOYEE_ID column of the EMPLOYEES table. Which two statements regarding the EMP_ID_SEQ sequence are true? ()

题型:多项选择题

Which two statements about subqueries are true? ()

题型:多项选择题

The user Alice wants to grant all users query privileges on her DEPT table. Which SQL statement accomplishes this? ()

题型:单项选择题

Examine these statements:CREATE ROLE registrarGRANT UPDATE ON dtudent_grades TO registrar;GRANT registrar to user1, user2, user3;What does this set of SQL statements do? ()

题型:单项选择题

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2 (25)LAST_NAME VARCHAR2 (25)HIRE_DATE DATEWhich UPDATE statement is valid? ()

题型:单项选择题

Examine the structure of the STUDENTS table:STUDENT_ID NUMBER NOT NULL, Primary KeySTUDENT_NAME VARCHAR2(30)COURSE_ID VARCHAR2(10) NOT NULLMARKS NUMBERSTART_DATE DATEFINISH_DATE DATEYou need to create a report of the 10 students who achieved the highest ranking in the course INT SQL and who completed the course in the year 1999.Which SQL statement accomplishes this task? ()

题型:单项选择题

User Mary has a view called EMP_DEPT_LOC_VU that was created based on the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. She has the privilege to create a public synonym, and would like to create a synonym for this view that can be used by all users of the database. Which SQL statement can Mary use to accomplish that task?()

题型:单项选择题

Which are /SQL*Plus commands? ()

题型:多项选择题