Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a SQL query to find the employees who work as FI _ ACCOUNT or ST _ CLERK, are in Southlake, Texas or Seattle, Washington,
Write a SQL query to find the employees who work as FIACCOUNT or STCLERK, are in Southlake,
Texas or Seattle, Washington, have more than years of experience, and do not receive a
commission. Sort the results in ascending order of their department location. Return employee ID
employee name, salary, and department name.
For this, you will have to create a new table called dept using subqueries. The structure and data for
this new table will come from the HR tables departments and locations. This new dept table should
contain only the info from locations and departments needed for the solution.
First, use a subquery to create the structure for dept with no data.
Then, populate the dept table using subqueries
Last, create a solution using subqueries to retrieve the employees that comply with the query
request. Any subquery is valid if the result is as expected.
Use subqueries to write a SQL query to find the employees of grades and salary within the
defined ranges Return all the information of employees and salary details, including grade, min,
and max for the corresponding salary.
For this, you will have to create a table salgrade with columns: grade as PK min, and max. Pick
the right domains according to the values in the following table
Populate this table with
Grade MIN MAX
G
G
G
G
G
Find the information of employees whose salary is greater than the salary of the employee whose
phone number is Return all the information about the employees Use subqueries
Display a list of departments names, managers full names, and employees full names for the
departments of Finance, IT and Purchasing. Use subqueries to determine the departments you
need.
Using the table salgrade created in question Write a SQL query to find those employees of
grades to working in the departments of Shipping or Sales, whose salaries are greater than the
salary of Kelly Chung, and who have been working at the company longer than Lindsey Smith.
Return complete information about these employees.
Write a query to retrieve employees who work in the same department as Payam Kaufling, and their
salary is higher than the salary of Hazel Philtanker. Exclude all those records where the first name
starts with either J or P Return first name, last name, salary, and hire date.
Step 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