Answered step by step
Verified Expert Solution
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:
- 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.
- 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.
- Modify the query above to only look for employees that were hired in 1999. Sort the new output by the Name Field.
- 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.
- 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.
- Write a query to show the average salary and count of each department. Round to the nearest whole dollar.
- 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.
- 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
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