Employees Earning Above Department Average

Company: Tiger_Analytics_9jan

Difficulty: medium

Problem Statement

Employees Earning Above Department Average You are given data of employees along with their departments. Write an SQL query to select the employee ID, employee name and salary of every employee whose salary is greater than or equal to the average salary of their own department . The result must be ordered by employeeId in ascending order. This is an SQLite question: only SQLite syntax and SELECT queries will work. Do not use UPDATE , DELETE and so on. Table: Department Column Data Type Description departmentId INTEGER Primary key: unique id of the department departmentName VARCHAR Name of the department (unique) Table: Employee Column Data Type Description employeeId INTEGER Primary key: unique id of the employee departmentId INTEGER The employee's department (references Department.departmentId ) employeeName VARCHAR Name of the employee (two employees may have the same name) location VARCHAR Work location of the employee salary INTEGER Salary of the employee Expected Output Return the