如果存在一张表格表示员工信息 Employees(ID,Name,Gender,ReportsTo),其中 ReportsTo 为外码,用于表示该员工的直接上级领导,那么要查询出结果(ID,Name,LeaderName),SQL 是Select ID, Name, u.Name As LeaderName From Employees e JOIN Empoyees u ON e.ID = u.ReportsTo

如果存在一张表格表示员工信息 Employees(ID,Name,Gender,ReportsTo),其中 ReportsTo 为外码,用于表示该员工的直接上级领导,那么要查询出结果(ID,Name,LeaderName),SQL 是Select ID, Name, u.Name As LeaderName From Employees e JOIN Empoyees u ON e.ID = u.ReportsTo


参考答案和解析
错误

相关考题:

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary KeyFIRST_NAME VARCHAR2(25)LAST_NAME VARCHAR2(25)DEPARTMENT_ID NUMBERSALARY NUMBERWhat is the correct syntax for an inline view? ()A. SELECT a.last_name, a.salary, a.department_id, b.maxsal FROM employees a, (SELECT department_id, max(salary)maxsal FROM employees GROUP BY department_id) b WHERE a.department_id = b.department_id AND a.salary b.maxsal;B. SELECT a.last name, a.salary, a.department_id FROM employees a WHERE a.department_id IN (SELECT department_id FROM employees b GROUP BY department_id having salary = (SELECT max(salary) from employees))C. SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE a.salary = (SELECT max(salary) FROM employees b WHERE a.department _ id = b.department _ id);D. SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE (a.department_id, a.salary) IN (SELECT department_id, a.salary) IN (SELECT department_id max(salary) FROM employees b GROUP BY department_id ORDER BY department _ id);

Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEESColumn name Data type RemarksEMPLOYEE_ID NUMBER NOT NULL, Primary KeyEMP_NAME VARCHAR2 (30)JOB_ID VARCHAR2 (20)SALARY NUMBERMGR_ID NUMBER References EMPLOYEE_ID COLUMNDEPARTMENT ID NUMBER Foreign key to DEPARTMENT ID column of the DEPARTMENTS tableDEPARTMENTSColumn name Data type RemarksDEPARTMENT_ID NUMBER NOT NULL, Primary Key DEPARTMENT_NAME VARCHAR2(30)MGR_ID NUMBER References MGR_ID column of the EMPLOYEES tableEvaluate this SQL statement:SELECT employee_id, e.department_id, department_name, salaryFROM employees e, departments dWHERE 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);

ExhibitExamine the data in the EMPLOYEES and DEPARTMENTS tables.You want to retrieve all employees‘ last names, along with their manager‘s 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 department 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.managaer_id = m.employee_id) LEFT OUTER JOIN department d ON (e.department_id = d.department_id);C. SELECT e.last_name, m.last_name, department_name FROM employees e RIGT OUTER JOIN employees m on ( e.manager_id = m.employee_id) FULL OUTER JOIN department 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) RIGT OUTER JOIN department 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 department d ON (e.department_id = d.department_id);

Examine the structure of the EMPLOYEES and DEPARTMENTS tables:EMPLOYEESEMPLOYEE_ID NUMBERDEPARTMENT_ID NUMBERMANAGER_ID NUMBERLAST_NAME VARCHAR2(25)DEPARTMENTSDEPARTMENT_ID NUMBERMANAGER_ID NUMBERDEPARTMENT_NAME VARCHAR2(35)LOCATION_ID NUMBERYou want to create a report displaying employee last names, department names, and locations. Which query should you use to create an equi-join?()A. SELECT last_name, department_name, location_id FROM employees , department ;B. SELECT employees.last_name, departments.department_name, departments.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;C. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE manager_id = manager_id;D. SELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;

The EMPLOYEES table contains these columns:EMPLOYEE_ID NUMBER(4)LAST_NAME VARCHAR2 (25)JOB_ID VARCHAR2(10)You want to search for strings that contain ‘SA_‘ in the JOB_ID column. Which SQL statement do you use?()A. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA\_%‘ESCAPE‘\‘;B. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA_‘;C. SELECT employee_id, last_name, job_id FROM employees WHERE job_id LIKE ‘%SA_‘ESCAPE‘\‘;D. SELECT employee_id, last_name, job_id FROM employees WHERE job_id ‘%SA_‘;

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

Click the Exhibit button to examine the data of the EMPLOYEES table. Evaluate this SQL statement:SELECT e.employee_id Emp_id, e.emp_name Employee, e.salary, m.employee_id Mgr_id, m.emp_name ManagerFROM employees e JOIN employees m ON (e.mgr_id = m.employee_id)AND e.salary 4000;What is its output?()A.AB.BC.CD.DE.E

Click the Exhibit button to examine the data of the EMPLOYEES table.Which statement lists the ID, name, and salary of the employee, and the ID and name of the employee‘s manager, for all the employees who have a manager and earn more than 4000?()A.SELECT employee_id Emp_id, emp_name Employee, salary, employee_id Mgr_id, emp_name Manager FROM employees WHERE salary 4000;B.SELECT e.employee_id Emp_id, e.emp_name Employee, e.salary, m.employee_id Mgr_id, m.emp_name Manager FROM employees e JOIN employees m WHERE e.mgr_id = m.mgr_id AND e.salary 4000;C.SELECT e.employee_id Emp_id, e.emp_name Employee, e.salary, m.employee_id Mgr_id, m.emp_name Manager FROM employees e JOIN employees m ON (e.mgr_id = m.employee_id) AND e.salary 4000;D.SELECT e.employee_id Emp_id, e.emp_name Employee, e.salary, m.mgr_id Mgr_id, m.emp_name Manager FROM employees e SELF JOIN employees m WHERE e.mgr_id = m.employee_id AND e.salary 4000;E.SELECT e.employee_id Emp_id, e.emp_name Employee, e.salary, m.mgr_id Mgr_id m.emp_name Manager FROM employees e JOIN employees m USING (e.employee_id = m.employee_id) AND e.salary 4000;

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

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 description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) Which statement produces the number of different departments that have employees with last name Smith?()A、SELECT COUNT(*) FROM employees WHERE last_name='Smith';B、SELECT COUNT(dept_id) FROM employees WHERE last_name='Smith';C、SELECT DISTINCT(COUNT(dept_id)) FROM employees WHERE last_name='Smith';D、SELECT COUNT(DISTINCT dept_id) FROM employees WHERE last_name='Smith';E、SELECT UNIQUE(dept_id) FROM employees WHERE last_name='Smith';

Examine the structure of the EMPLOYEES and NEW_EMPLOYEES tables: EMPLOYEES EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) HIRE_DATE DATE NEW_EMPLOYEES EMPLOYEE_ID NUMBER Primary Key NAME VARCHAR2 (60) Which DELETE statement is valid?()A、DELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);B、DELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_ employees);C、DELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = 'carrey');D、DELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = 'carrey');

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 table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER SALARY NUMBER What is the correct syntax for an inline view?()A、SELECT a.last_name, a.salary, a.department_id,B、maxsal FROM employees a, (SELECT department_id, max(salary)maxsal FROM employees GROUP BY department_id) b WHERE a.department_id = b.department_id AND a.salary b.maxsal;C、SELECT a.last name, a.salary, a.department_id FROM employees a WHERE a.department_id IN (SELECT department_id FROM employees b GROUP BY department_id having salary = (SELECT max(salary) from employees))D、SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE a.salary = (SELECT max(salary) FROM employees b WHERE a.department _ id = b.department _ id);E、SELECT a.last_name, a.salary, a.department_id FROM employees a WHERE (a.department_id, a.salary) IN (SELECT department_id, a.salary) IN (SELECT department_id max(salary) FROM employees b GROUP BY department_id ORDER BY department _ id);

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

Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEES EMPLOYEE_ID NUMBER DEPARTMENT_ID NUMBER MANAGER_ID NUMBER LAST_NAME VARCHAR2(25) DEPARTMENTS DEPARTMENT_ID NUMBER MANAGER_ID NUMBER DEPARTMENT_NAME VARCHAR2(35) LOCATION_ID NUMBER You want to create a report displaying employee last names, department names, and locations. Which query should you use?()A、SELECT e.last_name, d. department_name, d.location_id FROM employees e NATURAL JOIN departments D USING department_id ;B、SELECT last_name, department_name, location_id FROM employees NATURAL JOIN departments WHERE e.department_id =d.department_id;C、SELECT e.last_name, d.department_name, d.location_id FROM employees e NATURAL JOIN departments d;D、SELECT e.last_name, d.department_name, d.location_id FROM employees e JOIN departments d USING (department_id );

单选题Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) DEPARTMENT_ID NUMBER SALARY NUMBER What is the correct syntax for an inline view?()ASELECT a.last_name, a.salary, a.department_id,Bmaxsal FROM employees a, (SELECT department_id, max(salary)maxsal FROM employees GROUP BY department_id) b WHERE a.department_id = b.department_id AND a.salary b.maxsal;CSELECT a.last name, a.salary, a.department_id FROM employees a WHERE a.department_id IN (SELECT department_id FROM employees b GROUP BY department_id having salary = (SELECT max(salary) from employees))DSELECT a.last_name, a.salary, a.department_id FROM employees a WHERE a.salary = (SELECT max(salary) FROM employees b WHERE a.department _ id = b.department _ id);ESELECT a.last_name, a.salary, a.department_id FROM employees a WHERE (a.department_id, a.salary) IN (SELECT department_id, a.salary) IN (SELECT department_id max(salary) FROM employees b GROUP BY department_id ORDER BY department _ id);

单选题Examine the structure of the EMPLOYEES and DEPARTMENTS tables: EMPLOYEES EMPLOYEE_ID NUMBER DEPARTMENT_ID NUMBER MANAGER_ID NUMBER LAST_NAME VARCHAR2(25) DEPARTMENTS DEPARTMENT_ID NUMBER MANAGER_ID NUMBER DEPARTMENT_NAME VARCHAR2(35) LOCATION_ID NUMBER You want to create a report displaying employee last names, department names, and locations. Which query should you use to create an equi-join?()ASELECT last_name, department_name, location_id FROM employees , department ;BSELECT employees.last_name, departments.department_name, departments.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;CSELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE manager_id = manager_id;DSELECT e.last_name, d.department_name, d.location_id FROM employees e, departments D WHERE e.department_id = d.department_id;

单选题Examine the description of the EMPLOYEES table: EMP_ID NUMBER(4) NOT NULL LAST_NAME VARCHAR2(30) NOT NULL FIRST_NAME VARCHAR2(30) DEPT_ID NUMBER(2) Which statement produces the number of different departments that have employees with last name Smith? ()ASELECT COUNT (*) FROM employees WHERE last _name='smith';BSELECT COUNT (dept_id) FROM employees WHERE last _name='smith';CSELECT DISTINCT (COUNT (dept_id) FROM employees WHERE last _name='smith';DSELECT COUNT (DISTINCT dept_id) FROM employees WHERE last _name='smith';ESELECT UNIQE (dept_id) FROM employees WHERE last _name='smith';

多选题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?()ASELECT emp_name, department_name, city FROM employees e JOIN departments d USING (department_id) JOIN locations 1 USING (location_id) WHERE salary 10000;BSELECT 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;CSELECT emp_name, department_name, city FROM employees e, departments d, locations 1 WHERE salary 10000;DSELECT 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;ESELECT emp_name, department_name, city FROM employees e NATURAL JOIN departments, locations WHERE salary 10000;

单选题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? ()ASELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);BSELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;CSELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;DSELECT 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 NEW_EMPLOYEES tables: EMPLOYEES EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2 (25) LAST_NAME VARCHAR2 (25) HIRE_DATE DATE NEW EMPLOYEES EMPLOYEE_ID NUMBER Primary Key NAME VARCHAR2 (60) Which DELETE statement is valid? ()ADELETE FROM employees WHERE employee_id = (SELECT employee_id FROM employees);BDELETE * FROM employees WHERE employee_id = (SELECT employee_id FROM new_ employees);CDELETE FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE name = ('Carrey')'DDELETE * FROM employees WHERE employee_id IN (SELECT employee_id FROM new_employees WHERE last_ name = ('Carrey')'

单选题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?()ASELECT last_name, department_name FROM employees NATURAL JOIN departments;BSELECT last_name, department_name FROM employees JOIN departments ;CSELECT last_name, department_name FROM employees e JOIN departments d ON (e.department_id = d.department_id);DSELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);ESELECT last_name, department_name FROM employees FULL JOIN departments ON (e.department_id = d.department_id);FSELECT 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?()ASELECT last_name, department_name FROM employees , departments(+);BSELECT last_name, department_name FROM employees JOIN departments(+);CSELECT last_name, department_name ON (e. department_ id = d. departments_id); FROM employees(+) e JOIN departments dDSELECT last_name, department_name FROM employees e RIGHT OUTER JOIN departments d ON (e.department_id = d.department_id);ESELECT last_name, department_name FROM employees(+) , departments ON (e. department _ id = d. department _id);FSELECT 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?()ASELECT employee_id, department_id, department_name, salary FROM employees WHERE department_id IN (SELECT department_id FROM departments);BSELECT employee_id, department_id, department_name, salary FROM employees NATURAL JOIN departments;CSELECT employee_id, d.department_id, department_name, salary FROM employees e JOIN departments d ON e.department _ id = d. department_id;DSELECT 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: EMPLOYEES EMPLOYEE_ID NUMBER DEPARTMENT_ID NUMBER MANAGER_ID NUMBER LAST_NAME VARCHAR2(25) DEPARTMENTS DEPARTMENT_ID NUMBER MANAGER_ID NUMBER DEPARTMENT_NAME VARCHAR2(35) LOCATION_ID NUMBER You want to create a report displaying employee last names, department names, and locations. Which query should you use?()ASELECT e.last_name, d. department_name, d.location_id FROM employees e NATURAL JOIN departments D USING department_id ;BSELECT last_name, department_name, location_id FROM employees NATURAL JOIN departments WHERE e.department_id =d.department_id;CSELECT e.last_name, d.department_name, d.location_id FROM employees e NATURAL JOIN departments d;DSELECT e.last_name, d.department_name, d.location_id FROM employees e JOIN departments d USING (department_id );