Skip to main content

Setting up for exercise

Refer to the details here and get the setup ready before testing the samples

Aggregate functions

  1. Find the total number of employees in the company.
  2. Calculate the average salary of all employees.
  3. Get the highest salary in the company.
  4. Find the lowest salary in the company.
  5. Count the number of employees in each department.
  6. Find the total salary expense for each department.
  7. Get the average salary for employees in the IT department.
  8. Retrieve the number of mentors assigned to each employee (group by EMP_ID).
  9. Display the total number of employees, total salary, and average salary in a single query.
  10. Get the employees who have a salary above the company-wide average salary.

SQL Joins

  1. Retrieve the employee names and their corresponding mentor skills.
  2. List all employees, including those who don’t have a mentor, showing their names and mentor skills (if any).
  3. List all mentors and the names of the employees they are assigned to, including mentors who don’t have a corresponding employee record.
  4. Find employees who share the same department, showing both employee names in the result.
  5. Retrieve each employee’s name along with the total number of mentors they have.