Question
Tables: department, dept_emp, dept_manager, employees, salaries, titles department (columns): dept_no, dept_name dept_emp (columns): emp_no, dept_no, from_date, to_date dept_manager (columns): emp_no, dept_no, from_date, to_date employees (columns):
Tables: department, dept_emp, dept_manager, employees, salaries, titles
department (columns): dept_no, dept_name
dept_emp (columns): emp_no, dept_no, from_date, to_date
dept_manager (columns): emp_no, dept_no, from_date, to_date
employees (columns): emp_no, birth_date, first_name, last_name, gender, hire_date
salaries (columns): emp_no, salary, from_date, to_date
titles (columns): emp_no, title, from_date, to_date
I need help with writing SQL queries for the questions below. The information about the tables in the SQL database are listed above.
1) What queries are needed for the following:
a) What is the ratio of salary of female / male in the company? Do we have equal pay in this company?
b) Who was the first department manager?
c) Who was the first department manager?
d) Is there any department which has more than one manager?
e) Is there any employee who does not work for any department?
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