#412 Minimum and Maximum Salary by Unit
The database contains two tables: "units" for company units and "employees" for company employees:
units:
id // Primary Key
name // unit name
employees:
id // Primary Key
unit_id // Foreign Key -> units::id
salary // salary
fired // dismissed flag
Write an SQL query that returns the minimum and maximum salary for every unit among employees who have not been dismissed: unit_id, min_salary, max_salary.
Question review
Sign in to start the dialogue
The mentor keeps the context of the current question and your previous messages.
Sign in
Available with Premium
This is just one of the solutions available with Premium. And more:
- 250+ advanced lectures
- 1300+ practice exercises
- 500+ solutions to problems from real interviews
- Personalized Java Hub certificates
- Expanded access to the AI mentor