Top 50 sql Interview Questions
The most frequently asked sql questions across all roles and companies, ranked by real interview frequency. Updated daily.
Optimize a slow PostgreSQL query that aggregates completed transactions while preserving customers with no matching activity.
Capgemini
NomuraCalculate a three-day moving average of active-client revenue using aggregation and SQL window functions.
Return the second-highest distinct non-null salary from a single employee table.
PayU
Itc InfotechCalculate three-day rolling average sales by region using aggregation, joins, and PostgreSQL window functions.
AAreteSSweetwaterRRichemontUse SQL window functions to rank regions by average 2024 yield within each country.
Ernst & Young
KBR
Maximus TechExplain how TRUNCATE and DELETE differ in row removal, transaction behavior, and identity handling.
ArcesiumFind the second highest distinct salary and adapt the query to retrieve any requested salary rank.
Tech Mahindra
Snowflake ComputingKKGISLOptimize a PostgreSQL reporting query by reducing scanned rows, preserving unmatched records, and selecting the latest related review efficiently.
Tata Consultancy Services (North America)PPriority Technology Holdings, LLC
ZillowSign up to see every question
Create a free account to unlock this list and practice real interview questions.