Answered! 1. List first name,last name and the current salary of all current employees making more than $90,000 (assume that…

DROP TABLE IF EXISTS dept emp, dept manager, titles, salaries employees, departments; CREATE TABLE employees INT NOT NULL emp no birth date DATE NOT NULL, first name VARCHAR(14) NOT NULL, last name VARCHAR(16) NOT NULL, ENUM (M, F) NOT NULL gender NOT NULL hire date DATE PRIMARY KEY (emp no) CREATE TABLE departments NOT NULL, dept no CHAR (4) dept name VARCHAR (40) NOT NULL, PRIMARY KEY (dept no), UNIQUE KEY (dept name) CREATE TABLE dept manager NOT NULL, INT emp no NOT NULL, CHAR (4) dept no NOT NULL, from date DATE DATE NOT NULL, to date FOREIGN KEY (emp no) REFERENCES employees (emp no) ON DELETE CASCADE, FOREIGN KEY (dept no) REFERENCES departments (dept no) ON DELETE CASCADE, PRIMARY KEY (emp no, dept no)

1. List first name,last name and the current salary of all current employees making more than $90,000 (assume that for current employees to_date field = ‘9999-01-01’ ).

2. List first name,last name and the department name of all current employees whose current department number is “d008” or “d009”

3. List first name,last name and the title of all current female employees who have the title as “Technique Leader”.

4. List first name,last name and the current salary of all the current employees except “Senior Engineer”. (lowest salaries first)

5. List the first name,last name, and the birth date all employees (current and past – youngest employee first)

6. List the first name and last name of all current employees who are department managers in all current departments.

7. List the first name,last name and current department of the employee who is paid the maximum salary(one line of output only)

Expert Answer

Providing the responses for the first 5 queries:

1) select e.first_name,e.last_name,s.salary from employees e, salary s where s.salary > 90000;

2) select e.first_name,e.last_name,d.dept_name from employees e,departments d where d.dept_no IN (‘d008′,’d009′);

3) select e.first_name,e.last_name,t.title from employees e, titles t where e.gender=’F’ AND t.title=’Technique Leader’;

4) select e.first_name,e.last_name,s.salary from employees e, titles t,salary s where t.title <> ‘Senior Engineer’ order by s.salary ASC ;

5) select e.first_name,e.last_name,e.birth_date from employees e order by e.birth_date DESC;

Still stressed from student homework?
Get quality assistance from academic writers!