Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with these SQL queries: Write a query that displays the first name and the length of the first name for all employees

I need help with these SQL queries:

  1. Write a query that displays the first name and the length of the first name for all employees whose name starts with the letters "K" "R" or "M" salary. Name the first column 'First Name' and the second column 'Length'. Sort the results in descending order of employees' salary.
  2. Rewrite the query above so that the first name and last name fields are combined into one field called Full Name. Change Length to look for the Substring between characters 1 and 3. Label with Name Abbr. Create a calculated field named Yearly Salary that multiplIes the salary field by 12.
  3. Modify the query above to only look for employees that were hired in 1999. Sort the new output by the Name Field.
  4. Create a query that displays the employees' last names and commission amounts. If an employee does not earn commission, show "No Commission." Label the column COMM.
  5. The HR department wants to find the duration of employment for each employee. For each employee, display the last name and calculate the number of months between today and the date on which the employee was hired. Label the column as 'MONTHS_WORKED'. Order your results by the number of months employed. Round the number of months up to the closest whole number.
  6. Write a query to show the average salary and count of each department. Round to the nearest whole dollar.
  7. Determine the numbers of managers without listing them in department number 100. Label the column Number of Managers. Hint: Use the MANAGER_ID column to determine the number of managers.
  8. Find the difference between the highest and lowest salaries for each job id. Label the column Wage Gap.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Accounting Information Systems

Authors: George H. Bodnar, William S. Hopwood

11th Edition

0132871939, 978-0132871938

More Books

Students also viewed these Databases questions