Top 50
Skill roadmap
Updated weekly · Last refresh Aug 30

Top 50 SQL Interview Questions

The most frequently asked questions on this topic across all roles and companies, ranked by real interview frequency. Updated weekly.

50questions
~17htotal time
953companies covered
Track your progressSign up free to work through all 50 questions and resume where you left off.
Start practicing free →
1
SubqueriesStart here. 4 questions · ~80 min
Second Highest Without AggregatesMedium
Practice
Recently asked

Find the second highest salary in each department without using aggregate functions.

SubqueriesRankingSelf-JoinsMicron Memory Malaysia Sdn BhdInformaticaExusia
Second Highest Trader SalaryEasy
Practice
Recently asked

Find the second highest distinct salary from a single table using basic PostgreSQL ordering and limiting.

SubqueriesRankingSortingAntraWNSState Street
More Subqueries questions with a free account
2
SQL & Data Manipulation5 questions · ~100 min
Analyze Customer Purchase Trends with Window FunctionsMedium
Practice
Recently asked

Calculate the monthly spending trends for customers using window functions and joins.

The Home DepotHewlett Packard EnterpriseConvoy
More SQL & Data Manipulation questions with a free account

Sign up to see every question

Create a free account to unlock this list and practice real interview questions.

Get my prep plan
3
Window Functions19 questions · ~380 min
7-Day Rolling Active UsersMedium
Practice
Recently asked

Compute daily active users and a 7-day rolling average using a CTE, distinct counts, and window functions.

Window FunctionsDate FunctionsRunning TotalsMetaAcumenCorning
Compare Weekly User Activity TrendsMedium
Practice
Recently asked

Aggregate user activity by week, then use LAG to compare sessions and watch time versus the prior active week.

Window FunctionsLag/LeadDate FunctionsPublishers Clearing HouseNBCUniversalInteractive Process Technology
More Window Functions questions with a free account
4
Ranking3 questions · ~60 min
Top Customers by Sales RevenueEasy
Practice
Recently asked

Use GROUP BY and SUM to rank the top 10 customers by total revenue from a single sales table.

RankingGroup ByAggregationsMastekSageThornburg Investment
Top Products by Sales RevenueMedium
Practice
Recently asked

Find the top 10 products by total sales revenue using joins, aggregation, and a CTE.

RankingGroup ByAggregationsRTXBlend3601010data
More Ranking questions with a free account
5
Group By3 questions · ~60 min
SQL Duplicate DetectionMedium
Practice
Recently asked

Find duplicate customer profiles by grouping on identifying fields and returning only repeated records.

Group ByHavingAggregationsUniversity of Southern CaliforniaCircle Internet FinancialRevature
More Group By questions with a free account
6
Joins8 questions · ~160 min
More Joins questions with a free account
7
More topics8 questions · ~160 min
More questions with a free account
The finish line: interview-readyComplete all 50 questions to finish this plan.