Video explains top-n queries in most detailed and simplified way. Crack any Interview question on Top-n SQL Queries.
Become an Expert by just watching this video.
#sql #TOPNQUERY #SQLQueries #SQLBeginner #oracle #MYSQL #POSTGRE #FETCH #anaytical #SQLINTERVIEW #NthSalary
5 methods to write queries:
Co-related subqueries/sub-queries
Rownum
Dense rank
row_number
Offset fetch
Queries
--organization wide
--find highest earning employee in the organization
--find lowest earning employee in the organization
--find 5th highest earning employee in the organization
--find 5th lowest earning employee in the organization
--find top 5 highest earning employee in the organization
--find 5 least earning employee in the organization
--find 3rd to 6th highest earning employee in the organization
--department wise
--find highest earning employee in the department
--find lowest earning employee in the department
--find 5th highest earning employee in the department
--find 5th lowest earning employee in the department
--find top 5 highest earning employee in the department
--find 5 least earning employee in the department
--find 3rd to 6th highest earning employee in the department
--job title
--find highest earning employee by job title
--find lowest earning employee by job title
--find 5th highest earning employee in the department
--find 5th lowest earning employee in the department
--find top 5 highest earning employee in the department
--find 5 least earning employee in the department