Question 12

Table Name: College

Relevant Table: College(Professor (Text), Department (text), Salary (INT))

Professor Department  Salary
John Computer Science 60,000
Van der Mechanical Engineering 57,500
Ackerman Physics 45,000
Suyash Mathematics 52,000
Simrit Computer Science 56,500
Jessica Computer Science 55,000
Jenny Personality Development 50,000

QUERY: Write a Query that returns the third-highest salary in the table. Duplicate salaries count as one.

Execute:      SELECT DISTINCT Salary
                    FROM College
                    ORDER BY Salary DESC
                     LIMIT 2, 1;

 
or              SELECT DISTINCT Salary
                    FROM College
                    ORDER BY Salary DESC
                     LIMIT 1 OFFSET 2;

Answer:

 Salary
55,000