20+ SQL Server Interview Questions : kzfaq.info/get/bejne/iauUdKlp0rmvg2g.html Software Architecture Interview Questions : kzfaq.info/get/bejne/d9qEmsaTsbXVfYE.html SQL Step by Step - kzfaq.info/get/bejne/q62cmbNq1J3PnY0.html SQL Server Joins : kzfaq.info/get/bejne/gbqmjKt209ranmw.html 20 MSBI Interview Questions : kzfaq.info/get/bejne/hN2Ppqt2sNSzhXk.html 10+ Power BI Interview Questions : kzfaq.info/get/bejne/edWqlpyIs6i2pGg.html Angular Step by Step Tutorial for Beginners : kzfaq.info/get/bejne/Y5-Glrposqioo2w.html 25 Angular Interview Questions : kzfaq.info/get/bejne/Y9CVotx1r6rXg4E.html 35 Important JavaScript Interview Questions : kzfaq.info/get/bejne/kMhkl7OanKmlfok.html 30 Important C# Interview Questions : kzfaq.info/get/bejne/eLGpoahztdfNeYE.html 25+ OOPS Interview Questions : kzfaq.info/get/bejne/q59pqqSgp9CopoU.html 25 Important ASP.NET Interview Questions : kzfaq.info/get/bejne/pr6dgMeer7unYJs.html 20 MySQL Interview Questions : kzfaq.info/get/bejne/b86WnaZep9a9YmQ.html 20 PHP Interview Questions : kzfaq.info/get/bejne/Z8iggbaq07vWnGw.html 5 MSBI Interview Questions : kzfaq.info/get/bejne/a6toZJiSvafbiYU.html
@keyurpanchal64522 жыл бұрын
Select * from employee E1 where n-1 = (select count(*) from employee E2 where E1.Salary < E2.Salary) n = nth highest salary.
@harishshah8967 Жыл бұрын
Thank you very much this was the easiest solution i could find on internet i'm glad i came across your comment
@angelanaya8037 Жыл бұрын
Never got such a simple explanation, Thank you very much sir
@SowndaryaS-ue7su15 күн бұрын
Really well explained topics.. I got new interest in learning .. Thank you..
@wishujadhav2 жыл бұрын
One of cross question asked by interviewer is, if more than one records having same 2nd higest salary, query in video gives only one record
@ryuzaki68652 жыл бұрын
Write a CTE (Common Table Expression) using DENSE_RANK() function.
@jyotirmoymaschatak25992 жыл бұрын
I was asked this question yesterday in the interview.
@hrudayaranjanmohanty26892 жыл бұрын
So Nicely Explained sir..
@Shanmugamanickavel Жыл бұрын
Your training is excellent
@AlokChandraShahiАй бұрын
Declare @N Int =2 Select EmployeeSalary From ( Select Dense_Rank() Over (Order By EmployeeSalary) SNo, EmployeeSalary From TblEmployee) temp Where SNo =@N
@tejap73082 жыл бұрын
Very helpful. Thank you very much sir
@sk_ashadul_islam11 ай бұрын
Instead of row_number we can use dense_rank , bcoz if the table has duplicate 2nd highest salary and we nned to show both then it is not possible by row_number()
@dileepkumars2 жыл бұрын
Fetch 1 offset n order by employeesalary should be the simplest way i think
@questpondvideos2 жыл бұрын
Definitely a simple solution, but offset and limit is not ANSI SQL.From TSQL point of view its the simplest solution.
@varshadeore154 Жыл бұрын
Very nice explanation as asual
@salarsayyad5522 Жыл бұрын
Bunch of thanks sir.🙏😊
@remmykesh55332 жыл бұрын
very helpful, thank you.
@suyashyadav65312 жыл бұрын
Great content as always.
@OggVorbis692 жыл бұрын
The video demonstrates well the idea but probably is not going to work if there are duplicated salaries in the table. To solve this group by the salary in the sub query. However using rank will be a better solution selecting the nth rank as the nth top salary. In places where top or rank is not available an insert into temp table with autooncrement first column and sequential select the nth row from it will do too.
@questpondvideos2 жыл бұрын
It surely works for duplicate , top secures it. Temp table would be a bad solution.
@saravanan.b2 жыл бұрын
In Oracle how can I find the same result. Top command will not work right?
@pulkitjain44762 жыл бұрын
use rank and select where rank = 1
@questpondvideos2 жыл бұрын
Rank is simple , LIMIT will more simple ,but these are TSQL. Will not work for other DB. In todays date with EF and Code first ANSI SQL has become more important. Thanks.
@sk_ashadul_islam11 ай бұрын
But if it is for 2nd highest salary and the table has duplicate top highest salary , Rank() will not give you exact results
@stewiegriffin65032 жыл бұрын
the problem for me is that I don't want to get a job, because then I have to go to work... So I prefer to go unprepared to the interview, and then blame the company for xenofobia. High 5 !
@kushagrasharma40612 жыл бұрын
I have paid to join the channel but still I am unable to get access to videos.
@questpondvideos2 жыл бұрын
Just make sure you are accessing membership videos from same google account from where you have made the purchase or you can contact youtube help center if you do not get the access.
@bitsdiaries Жыл бұрын
Did u get the access? Do u recommend it?
@dinkarjha4500 Жыл бұрын
In PostgreSQL how to achieve?
@poonamsify42766 ай бұрын
Thank you so much Sir
@sourabhthorat95502 жыл бұрын
CREATE FUNCTION getNthHighestSalary(@N INT) RETURNS INT AS BEGIN RETURN ( select distinct salary from Employee order by salary desc OFFSET @N-1 ROWS FETCH NEXT 1 ROWS ONLY ); END