READ Free Dumps For Oracle- 1z0-007
Question ID 7961 | Which two statements are true about WHERE and HAVING clauses? (Choose two) |
Option A | A WHERE clause can be used to restrict both rows and groups. |
Option B | A WHERE clause can be used to restrict rows only. |
Option C | A HAVING clause can be used to restrict both rows and groups. |
Option D | A HAVING clause can be used to restrict groups only. |
Option E | A WHERE clause CANNOT be used in a query of the query uses a HAVING clause. |
Option F | A HAVING clause CANNOT be used in subqueries. |
Correct Answer | BD |
Question ID 7962 | EMPLOYEES and DEPARTMENTS data: EMPLOYEES DEMP_NAME DEPT_ID MGR_ID JOB_ID SALARY EMPLOYEE_I 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 On the EMPLOYEES table, EMPLOYEE_ID is the primary key. MGR_ID is the ID managers and refers to the EMPLOYEE_ID. On the DEPARTMENTS table DEPARTMENT_ID is the primary key. Evaluate this UPDATE statement. UPDATE employees SET mgr_id = (SELECT mgr_id FROM employees WHERE dept_id= (SELECT department_id FROM departments WHERE department_name = 'Administration')), Salary = (SELECT salary FROM employees WHERE emp_name = 'Smith') WHERE job_id = 'IT_ADMIN'; What happens when the statement is executed? |
Option A | The statement executes successfully, leaves the manager ID as the existing value, and changes the salary to 4000 for the employees with ID 103 and 105. |
Option B | The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105. |
Option C | The statement executes successfully, changes the manager ID to NULL, and changes the salary to 4000 for the employees with ID 103 and 105. |
Option D | The statement fails because there is more than one row matching the employee name Smith. |
Option E | The statement fails because there is more than one row matching the IT_ADMIN job ID in the EMPLOYEES table. |
Option F | The statement fails because there is no 'Administration' department in the DEPARTMENTS table. |
Correct Answer | D |