Question
The HR department needs a report that displays the last name, department number, and job ID of all employees whose department location ID is 1800
The HR department needs a report that displays the last name, department number, and job ID of all employees whose department location ID is 1800 (NOTE: the location ID is a column attribute from the DEPARTMENTS table, not the EMPLOYEES table). Write this SQL statement as a subquery.
A fellow Database professional is attempting to create a report for HR that displays the last name and salary of every employee who reports to Steven King (in other words each employee who is assigned the manager_id that corresponds to the manager whose last name is King. The database professional created the SQL statement below, but unfortunately received the error following the code.
SELECT last_name, salary
FROM employees
WHERE manager_id = (SELECT employee_id
FROM employees
WHERE last_name = 'King');
ERROR RESULT:
A. Why did the database professional receive that error result?
B. How would you correct the code (write and run your corrected code)?
Create a report for HR that displays the department number, last name, and job ID for every employee in the Executive department (HINT: would you use an = or IN ?).
ERROR RESULT: 2 E SQL | Executing:SELECT last_name, salary FROM ORA-01427: single-row subquery returns more than one row 01427.00000 - "single-row subquery returns more than one row" *Cause: *Action: ERROR RESULT: 2 E SQL | Executing:SELECT last_name, salary FROM ORA-01427: single-row subquery returns more than one row 01427.00000 - "single-row subquery returns more than one row" *Cause: *ActionStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started