Company: Commmenwealth bank of Australia IITR
Difficulty: medium
Problem Description Write a SQL query to display the names of those employees whose teammate earns a strictly higher salary than they do. Schema There are three tables involved in this problem: employee Table Emp_Id (INT): The primary key for this table. Represents the unique ID of the employee. Name (VARCHAR): The name of the employee. team_mates Table Emp_Id (INT): A foreign key referencing employee.Emp_Id . Teammates_id (INT): A foreign key referencing employee.Emp_Id , representing the employee's teammate. salary Table Emp_Id (INT): The primary key for this table, and a foreign key referencing employee.Emp_Id . Salary (INT): The salary amount of the employee. Required Output Your query should return a single column named Name . The output must be ordered by the salary amount of the teammate in ascending order . Constraints or Notes It can be assumed that no two employees have the exact same salary. An employee will appear at most once in the team_mates.Emp_Id column (i.e., each emp