Answered step by step
Verified Expert Solution
Question
1 Approved Answer
List the first name and department an employee works for and how much less that employee makes than the highest paid employee in that company
List the first name and department an employee works for and how much less that employee makes than the highest paid employee in that company Three columns Third column should be subquery Hint: use MAX clause and do subtraction
create table employees ( employee_id INT, first_name VARCHAR(50), last_name VARCHAR(50), email VARCHAR(50), hire_date DATE, department VARCHAR(17), gender VARCHAR(1), salary INT, region_id INT, primary key (employee_id) ); insert into employees values (1, 'Berrie', 'Manueau', 'bmanueau0@dion.ne.jp', '2006-04-20', 'Sports', 'F', 154864, 4); insert into employees values (2, 'Aeriell', 'McNee', 'amcnee1@google.es', '2009-01-26', 'Tools', 'F', 56752, 3); insert into employees values (3, 'Sydney', 'Symonds', 'ssymonds2@hhs.gov', '2010-05-17', 'Clothing', 'F', 95313, 4); insert into employees values (4, 'Avrom', 'Rowantree', null, '2014-08-02', 'Phones & Tablets', 'M', 119674, 7);
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