Affine Analytics Interview Questions | How to get 3 Min salaries?
Question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
It will take less than 1 minute to register for lifetime. Bonus Tip - We don't send OTP to your email id Make Sure to use your own email id for free books and giveaways
Answers ( 3 )
select distinct(salary) from salary_details order by salary asc limit 3
SELECT DISTINCT salary
FROM employees a
WHERE 3 >= (SELECT COUNT(DISTINCT salary)
FROM employees b
WHERE b.salary <= a.salary)
ORDER BY a.salary DESC;
select DISTINCT (salary)
from Table
ORDER BY salary ASC
LIMIT 3;