Setting up for exercise
Refer to the details here and get the setup ready before testing the samples
Aggregate functions
- Find the total number of employees in the company.
- Calculate the average salary of all employees.
- Get the highest salary in the company.
- Find the lowest salary in the company.
- Count the number of employees in each department.
- Find the total salary expense for each department.
- Get the average salary for employees in the IT department.
- Retrieve the number of mentors assigned to each employee (group by EMP_ID).
- Display the total number of employees, total salary, and average salary in a single query.
- Get the employees who have a salary above the company-wide average salary.
SQL Joins
- Retrieve the employee names and their corresponding mentor skills.
- List all employees, including those who don’t have a mentor, showing their names and mentor skills (if any).
- List all mentors and the names of the employees they are assigned to, including mentors who don’t have a corresponding employee record.
- Find employees who share the same department, showing both employee names in the result.
- Retrieve each employee’s name along with the total number of mentors they have.