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) Retrieve the name (first name and last name) of employees based on their department and sort them base on their Salary descending.
b) Is there any employee who does not have a manager?
c) Is there any department which does not have any employee?
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