100%(1)1 out of 1 people found this document helpful
This preview shows page 1 - 2 out of 6 pages.
LA9 Which of the following is CORRECT about sub-queries? Subquery execute before the main query executes. SELECT * FROM employees WHERE salary = (SELECT salary from employees where employee_id= 103) Which of the following is INCORRECT? Use single-row operators with multiple-row subqueries Which of the folllowing is required in a subquery? SELECT Sh9 Evaluate the SQL command SELECT employee_id, job_id, salary from employees where salary < ALL (SELECT salary FROM employees WHERE job_id = 'FI_ACCOUNT') AND job_id = 'IT_PROG' The correct answer is: This has no error. You want to display all records in the database whose salary is above the salary of Alexander Hunold. The correct answer is: SELECT * from employees WHERE salary < (SELECT salary FROM employees WHERE first_name = 'Alexander' AND last_name = 'Hunold') You want to display the department name the same with the location of the Purchasing department. The correct answer is: SELECT department_name from departments where location_id = (SELECT location_id from departments where department_name = 'Purchasing') Evaluate the SQL command SELECT employee_id, last_name, first_name, job_id FROM employees WHERE department_id = (SELECT max(department_id) FROM employees GROUP BY department_id) The correct answer is: This will return an error. Single-row subquery returns more than one row.