Question
1. Select employees who work in departments A-C and create a column where employee names are presented in a following format: First_letter_of_firstname. Surname (For example
1. Select employees who work in departments A-C and create a column where employee names are presented in a following format: First_letter_of_firstname. Surname (For example B. JOHNSON). In addition for this new name column, present department and its duty in the result set. Order result set by surname.
2.Select all employees and include also those who don't have department set. Include firstname, surname, department and duty of department in the result set. (Please notice that by default all employees have department set so this query won't return any extra rows with default data!)
3.Select employees whose province (PROV) is either MB or ON and whose manager is Doe G. Present employee number, whole name and province in the result set.
4.Select all managers whose firstname starts with letter M and department they lead have less than 10 employees. Present manager and employee count in the result set. Order result set by employee count in descending order.
5.Create two columns for the result set: One for employees so that employee name is presented in the following format: || Surname -- Firstname || (for example || Johnson -- Mike ||) and another which tells whether the person is an employee or a manager. Give columns the following names for the result set: Name and Type. Order results primarily by type and secondarily by name.
. MTN LTE 7:20 PM 12% exercises in this course (SQL basics 1-5) The structure of the database is shown below SDEPT AOC DEPT ABC MANAGER 123 CODE DEPT PAS DEPT ABC MANAGER ADC DUTY 123 BUDGET EMPS 12 EMPNUM ABC DEPT ADC SURNAME ADC GNAME AC ADDRESS ABC CITY ABC PROV ADC PC ABC PHONE 123 RATE 123 TAXCODE 123 DEDUCTION Return exercise in .txt format and use formatting presented below (question always followed be the query)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