网友您好, 请在下方输入框内输入要搜索的题目:

题目内容 (请给出正确答案)
单选题
Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 Kochhar 5000 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Sales 20 Marketing 30 Accounts 40 Administration You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()
A

SELECT last_name, department_name FROM employees , departments(+);

B

SELECT last_name, department_name FROM employees JOIN departments(+);

C

SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments d

D

SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);

E

SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);

F

SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);


参考答案

参考解析
解析: 暂无解析
更多 “单选题Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 Kochhar 5000 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Sales 20 Marketing 30 Accounts 40 Administration You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A SELECT last_name, department_name FROM employees , departments(+);B SELECT last_name, department_name FROM employees JOIN departments(+);C SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dD SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);F SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);” 相关考题
考题 Examine the data in the EMPLOYEES table:Which three subqueries work? () A. SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);C. SELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);D. SELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);E. SELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);F. SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));

考题 Examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables.EMPLOYEESNOT NULL,EMPLOYEE_ID NUMBERPrimary KeyVARCHAR2EMP_NAME(30)VARCHAR2JOB_ID(20)SALARY NUMBERReferencesMGR_ID NUMBEREMPLOYEE_IDcolumnDEPARTMENT_ID NUMBER Foreign key toDEPARTMENT_IDcolumn of theDEPARTMENTStableDEPARTMENTSNOT NULL, PrimaryDEPARTMENT_ID NUMBERKeyVARCHAR2DEPARTMENT_NAME(30)References NGR_IDMGR_ID NUMBERcolumn ofthe EMPLOYEES tableForeign key toLOCATION_ID NUMBERLOCATION_IDcolumn of theLOCATIONS tableLOCATIONSNOT NULL, PrimaryLOCATION_ID NUMBERKeyVARCHAR2CITY|30)Which two SQL statements produce the name, department name, and the city of all the employees who earn more then 10000?()A. SELECT emp_name, department_name, city FROM employees e JOIN departments d USING (department_id) JOIN locations 1 USING (location_id) WHERE salary 10000;B. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 JOIN ON (e.department_id = d.department id) AND (d.location_id =1.location_id) AND salary 10000;C. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE salary 10000;D. SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE e.department_id = d.department_id AND d.location_id = 1.location_id AND salary 10000;E. SELECT emp_name, department_name, city FROM employees e NATURAL JOIN departments, locations WHERE salary 10000;

考题 Examine the data in the EMPLOYEES and DEPARTMENTS tables:Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:On the EMPLOYEES table, EMPLOYEE_ID is the primary key.MGR_ID is the ID of managers and refers to the EMPLOYEE_ID.DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table.On the DEPARTMENTS table, DEPARTMENT_ID is the primary key.Examine this DELETE statement:What happens when you execute the DELETE statement?()A. Only the row with department ID 40 is deleted in the DEPARTMENTS table.B. The statement fails because there are child records in the EMPLOYEES table with department ID 40.C. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.D. The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.E. The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.F. The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.

考题 Examine the data in the EMPLOYEES and DEPARTMENTS tables:EMPLOYEESEMP_NAME DEPT_ID MGR_ID JOB_ID SALARYEMPLOYEE_ID101 Smith 20 120 SA_REP 4000102 Martin 10 105 CLERK 2500103 Chris 20 120 IT_ADMIN 4200104 John 30 108 HR_CLERK 2500105 Diana 30 108 IT_ADMIN 5000106 Smith 40 110 AD_ASST 3000108 Jennifer 30 110 HR_DIR 6500110 Bob 40 EX_DIR 8000120 Ravi 20 110 SA*DIR 6500DEPARTMENTSDEPARTMENT_ID DEPARTMENT_NAME10 Admin20 Education30 IT40 Human ResourcesAlso examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables:CREATE TABLE departments(department_id NUMBER PRIMARY KEY,department _ name VARCHAR2(30));CREATE TABLE employees(EMPLOYEE_ID NUMBER PRIMARY KEY,EMP_NAME VARCHAR2(20),DEPT_ID NUMBER REFERENCESdepartments(department_id),MGR_ID NUMBER REFERENCESemployees(employee id),MGR_ID NUMBER REFERENCESemployees(employee id),JOB_ID VARCHAR2(15).SALARY NUMBER);ON the EMPLOYEES,On the EMPLOYEES table, EMPLOYEE_ID is the primary key.MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table. On the DEPARTMENTS table, DEPARTMENT_ID is the primary key.Examine this DELETE statement:DELETEFROM departmentsWHERE department id = 40;What happens when you execute the DELETE statement?()

考题 Examine the data in the EMPLOYEES table:LAST_NAME DEPARTMENT_ID SALARYGetz 10 3000Davis 20 1500Bill 20 2200Davis 30 5000...Which three subqueries work? () A. SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);C. SELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);D. SELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);E. SELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);F. SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));

考题 Examine the data in the EMPLOYEES and DEPARTMENTS tables.EMPLOYEESLAST_NAME DEPARTMENT_ID SALARYGetz 10 3000Davis 20 1500Bill 20 2200Davis 30 5000Kochhar 5000DEPARTMENTSDEPARTMENT_ID DEPARTMENT_NAME10 Sales20 Marketing30 Accounts40 AdministrationYou want to retrieve all employees, whether or not they have matching departments in the departments table.Which query would you use?()A. SELECT last_name, department_name FROM employees , departments(+);B. SELECT last_name, department_name FROM employees JOIN departments(+);C. SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dD. SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E. SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);F. SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);

考题 Click the Exhibit button and examine the data in the EMPLOYEES table.Which three subqueries work? () A.SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department_id);B.SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);C.SELECT distinct department_id FROM employees WHERE salary ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);D.SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);E.SELECT last_name FROM employees WHERE salary ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);F.SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));

考题 You need to create a view EMP_VU. The view should allow the users to manipulate 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;

考题 Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables.You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A、SELECT last_name, department_name FROM employees NATURAL JOIN departments;B、SELECT last_name, department_name FROM employees JOIN departments ;C、SELECT last_name, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id);D、SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E、SELECT last_name, department_name FROM employees FULL JOIN departments ON (e.department_id = d.department_id);F、SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);

考题 Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement? ()A、SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);B、SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;C、SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;D、SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

考题 Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement?()A、SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);B、SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;C、SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;D、SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

考题 Click the Exhibit button and examine the data in the EMPLOYEES table. Which three subqueries work?()A、SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department_id);B、SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);C、SELECT distinct department_id FROM employees WHERE salary ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);D、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);E、SELECT last_name FROM employees WHERE salary ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);F、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));

考题 Examine the data in the EMPLOYEES and DEPARTMENTS tables: EMPLOYEES EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA*DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables: CREATE TABLE departments (department_id NUMBER PRIMARY KEY, department _ name VARCHAR2(30)); CREATE TABLE employees (EMPLOYEE_ID NUMBER PRIMARY KEY, EMP_NAME VARCHAR2(20), DEPT_ID NUMBER REFERENCES departments(department_id), MGR_ID NUMBER REFERENCES employees(employee id), MGR_ID NUMBER REFERENCES employees(employee id), JOB_ID VARCHAR2(15). SALARY NUMBER); ON the EMPLOYEES, On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table. On the DEPARTMENTS table, DEPARTMENT_ID is the primary key. Examine this DELETE statement: DELETE FROM departments WHERE department id = 40; What happens when you execute the DELETE statement?()A、Only the row with department ID 40 is deleted in the DEPARTMENTS table.B、The statement fails because there are child records in the EMPLOYEES table with department ID 40.C、The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.D、The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.E、The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.F、The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.

考题 Examine the data in the EMPLOYEES table: LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 ... Which three subqueries work? ()A、SELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);B、SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);C、SELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);D、SELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);E、SELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);F、SELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));

考题 Examine the structure of the EMP_DEPT_VU view: Column Name Type Remarks EMPLOYEE_ID NUMBER From the EMPLOYEES table EMP_NAME VARCHAR2(30) From the EMPLOYEES table JOB_ID VARCHAR2(20) From the EMPLOYEES table SALARY NUMBER From the EMPLOYEES table DEPARTMENT_ID NUMBER From the DEPARTMENTS table DEPT_NAME VARCHAR2(30) From the DEPARTMENTS table Which SQL statement produces an error?()A、SELECT * FROM emp_dept_vu;B、SELECT department_id, SUM(salary) FROM emp_dept_vu GROUP BY department _ id;C、SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department _ id, job_id;D、SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM (salary) 20000E、None of the statements produce an error; all are valid.

考题 Examine the structure of the EMPLOYEES, DEPARTMENTS, and LOCATIONS tables. EMPLOYEES NOT NULL, EMPLOYEE_ID NUMBER Primary Key VARCHAR2 EMP_NAME (30) VARCHAR2 JOB_ID (20) SALARY NUMBER References MGR_ID NUMBER EMPLOYEE_ID column DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table DEPARTMENTS NOT NULL, Primary DEPARTMENT_ID NUMBER Key VARCHAR2 DEPARTMENT_NAME (30) References NGR_ID MGR_ID NUMBER column of the EMPLOYEES table Foreign key to LOCATION_ID NUMBER LOCATION_ID column of the LOCATIONS table LOCATIONS NOT NULL, Primary LOCATION_ID NUMBER Key VARCHAR2 CITY |30) Which two SQL statements produce the name, department name, and the city of all the employees who earn more then 10000?()A、SELECT emp_name, department_name, city FROM employees e JOIN departments d USING (department_id) JOIN locations 1 USING (location_id) WHERE salary 10000;B、SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 JOIN ON (e.department_id = d.department id) AND (d.location_id =1.location_id) AND salary 10000;C、SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE salary 10000;D、SELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE e.department_id = d.department_id AND d.location_id = 1.location_id AND salary 10000;E、SELECT emp_name, department_name, city FROM employees e NATURAL JOIN departments, locations WHERE salary 10000;

考题 You need to create a view EMP_VU. The view should allow the users to manipulate 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 WITH department_id IN (10,20);E、CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;

考题 单选题Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement? ()A SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);B SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;C SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;D SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

考题 单选题Examine the data in the EMPLOYEES and DEPARTMENTS tables: EMPLOYEES EMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_ID 101 Smith 20 120 SA_REP 4000 102 Martin 10 105 CLERK 2500 103 Chris 20 120 IT_ADMIN 4200 104 John 30 108 HR_CLERK 2500 105 Diana 30 108 IT_ADMIN 5000 106 Smith 40 110 AD_ASST 3000 108 Jennifer 30 110 HR_DIR 6500 110 Bob 40 EX_DIR 8000 120 Ravi 20 110 SA*DIR 6500 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Admin 20 Education 30 IT 40 Human Resources Also examine the SQL statements that create the EMPLOYEES and DEPARTMENTS tables: CREATE TABLE departments (department_id NUMBER PRIMARY KEY, department _ name VARCHAR2(30)); CREATE TABLE employees (EMPLOYEE_ID NUMBER PRIMARY KEY, EMP_NAME VARCHAR2(20), DEPT_ID NUMBER REFERENCES departments(department_id), MGR_ID NUMBER REFERENCES employees(employee id), MGR_ID NUMBER REFERENCES employees(employee id), JOB_ID VARCHAR2(15). SALARY NUMBER); ON the EMPLOYEES, On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID of managers and refers to the EMPLOYEE_ID. DEPT_ID is foreign key to DEPARTMENT_ID column of the DEPARTMENTS table. On the DEPARTMENTS table, DEPARTMENT_ID is the primary key. Examine this DELETE statement: DELETE FROM departments WHERE department id = 40; What happens when you execute the DELETE statement?()A Only the row with department ID 40 is deleted in the DEPARTMENTS table.B The statement fails because there are child records in the EMPLOYEES table with department ID 40.C The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 110 and 106 are deleted from the EMPLOYEES table.D The row with department ID 40 is deleted in the DEPARTMENTS table. Also the rows with employee IDs 106 and 110 and the employees working under employee 110 are deleted from the EMPLOYEES table.E The row with department ID 40 is deleted in the DEPARTMENTS table. Also all the rows in the EMPLOYEES table are deleted.F The statement fails because there are no columns specifies in the DELETE clause of the DELETE statement.

考题 多选题Examine the data in the EMPLOYEES table: Which three subqueries work? ()ASELECT * FROM employees where salary (SELECT MIN(salary) FROM employees GROUP BY department _ id);BSELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);CSELECT distinct department_id FROM employees Where salary ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);DSELECT department_id FROM employees WHERE SALARY ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);ESELECT last_name FROM employees Where salary ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);FSELECT department_id FROM employees WHERE salary ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));

考题 单选题Examine the data in the EMPLOYEES and DEPARTMENTS tables. EMPLOYEES LAST_NAME DEPARTMENT_ID SALARY Getz 10 3000 Davis 20 1500 Bill 20 2200 Davis 30 5000 Kochhar 5000 DEPARTMENTS DEPARTMENT_ID DEPARTMENT_NAME 10 Sales 20 Marketing 30 Accounts 40 Administration You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A SELECT last_name, department_name FROM employees , departments(+);B SELECT last_name, department_name FROM employees JOIN departments(+);C SELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dD SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E SELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);F SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e. department _ id = d. department _id);

考题 单选题Examine the structure of the EMP_DEPT_VU view: Column Name Type Remarks EMPLOYEE_ID NUMBER From the EMPLOYEES table EMP_NAME VARCHAR2(30) From the EMPLOYEES table JOB_ID VARCHAR2(20) From the EMPLOYEES table SALARY NUMBER From the EMPLOYEES table DEPARTMENT_ID NUMBER From the DEPARTMENTS table DEPT_NAME VARCHAR2(30) From the DEPARTMENTS table Which SQL statement produces an error?()A SELECT * FROM emp_dept_vu;B SELECT department_id, SUM(salary) FROM emp_dept_vu GROUP BY department _ id;C SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department _ id, job_id;D SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM (salary) 20000E None of the statements produce an error; all are valid.

考题 单选题Examine the structure of the EMP_DEPT_VU view: Column Name Type Remarks EMPLOYEE_ID NUMBER From the EMPLOYEES table EMP_NAME VARCHAR2(30) From the EMPLOYEES table JOB_ID VARCHAR2(20) From the EMPLOYEES table SALARY NUMBER From the EMPLOYEES table DEPARTMENT_ID NUMBER From the DEPARTMENTS table DEPT_NAME VARCHAR2(30) From the DEPARTMENTS table Which SQL statement produces an error?()A SELECT * FROM emp_dept_vu;B SELECT department_id, SUM(salary) FROM emp_dept_vu GROUP BY department _ id;C SELECT department_id, job_id, AVG(salary) FROM emp_dept_vu GROUP BY department _ id, job_id;D SELECT job_id, SUM(salary) FROM emp_dept_vu WHERE department_id IN (10,20) GROUP BY job_id HAVING SUM (salary) 20000E None of the statements produce an error; all are valid.

考题 单选题You need to create a view EMP_VU. The view should allow the users to manipulate 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 WITH department_id IN (10,20);E CREATE FORCE VIEW emp_vu AS SELECT * FROM employees WHERE department_id IN (10,20) NO UPDATE;

考题 单选题You need to create a view EMP_VU. The view should allow the users to manipulate 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;

考题 单选题Click the Exhibit button and examine the data in the EMPLOYEES and DEPARTMENTS tables.You want to retrieve all employees, whether or not they have matching departments in the departments table. Which query would you use?()A SELECT last_name, department_name FROM employees NATURAL JOIN departments;B SELECT last_name, department_name FROM employees JOIN departments ;C SELECT last_name, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id);D SELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);E SELECT last_name, department_name FROM employees FULL JOIN departments ON (e.department_id = d.department_id);F SELECT last_name, department_name FROM employees e LEFT OUTER JOIN departments d ON (e.department_id = d.department_id);

考题 单选题Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type Remarks EMPLOYEE_ID NUMBER NOT NULL, Primary Key EMP_NAME VARCHAR2 (30) JOB_ID VARCHAR2 (20) SALARY NUMBER MGR_ID NUMBER References EMPLOYEE_ID COLUMN DEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS table DEPARTMENTSColumn name Data type Remarks DEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30) MGR_ID NUMBER References MGR_ID column of the EMPLOYEES table Evaluate this SQL statement: SELECT employee_id, e.department_id, department_name, salary FROM employees e, departments d WHERE e. department_id = d.department_id; Which SQL statement is equivalent to the above SQL statement?()A SELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);B SELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;C SELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;D SELECT employee_id, department_id, department_name, Salary FROM employees JOIN departments USING (e.department_id, d.department_id);

考题 单选题Examine the structure of the EMPLOYEES, DEPARTMENTS, and TAX tables. EMPLOYEES NOT NULL, Primary EMPLOYEE_ID NUMBER Key VARCHAR2 EMP_NAME (30) VARCHAR2 JOB_ID (20) SALARY NUMBER References MGR_ID NUMBER EMPLOYEE_ID column DEPARTMENT_ID NUMBER Foreign key to DEPARTMENT_ID column of the DEPARTMENTS table DEPARTMENTS NOT NULL, DEPARTMENT_ID NUMBER Primary Key VARCHAR2 DEPARTMENT_NAME |30| References MGR_ID column MGR_ID NUMBER of the EMPLOYEES table TAX MIN_SALARY NUMBER MAX_SALARY NUMBER TAX_PERCENT NUMBER 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 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 then 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.