DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPacksBlog
ProLogin

Interview Questions

Real questions from top companies in SQL

700+ Easy450+ Medium650+ Hard
All CategoriesBehavioralSpark/Big DataSQLPython/CodingSystem Design/ArchitectureCloud/ToolsGeneral/Othereasymediumhard
441

Write a SQL query to calculate the highest salary in each department using a window function

SQLmediumpartitionsqlwindow0.3 min read
Morgan Stanley
β†’
442

Write a SQL query to calculate the running total of sales per region, partitioned by year.

SQLmediumpartitionsql0.2 min read
PLEO
β†’
443

Write a SQL query to detect customers who have not placed a second order in 90 days.

SQLmediumpartitionsql0.3 min read
Amazon
β†’
444

Write a SQL query to find departments with more than 10 employees.

SQLmediumjoinsql0.2 min read
Incedo
β†’
445

Write a SQL query to find distinct IDs from a table where the count is more than 1 and greater than 200.

SQLeasysql0.3 min read
Dunnhumby
β†’
446

Write a SQL query to find employees earning the second-highest salary.

SQLmediumsql0.3 min read
Fragma Data Systems
β†’
447

Write a SQL query to find house with Avg(score) > 70.

SQLmediumjoinsql0.2 min read
HCL
β†’
448

Write a SQL query to find the second highest salary in each department.

SQLmediumpartitionsql0.2 min read
Delivery Hero
β†’
449

Write a SQL query to find the top 3 selling products per region in the last month.

SQLmediumpartitionsql0.3 min read
Amazon
β†’
450

Write a SQL query to find the top 5 most ordered dishes in the last 30 days.

SQLmediumjoinsql0.2 min read
Swiggy
β†’
451

Write a SQL query to find the top 5 products by sales per region.

SQLmediumpartitionsql0.2 min read
Fragma Data Systems
β†’
452

Write a SQL query to find users to recommend specific artists

SQLmediumjoinsql0.3 min read
media.net
β†’
453

Write a SQL query to rank shows by daily viewership across different regions

SQLmediumjoinpartitionsql0.2 min read
Netflix
β†’
454

Write a SQL query to remove duplicates from a table.

SQLmediumpartitionsql0.4 min read
Incedo
β†’
455

Write a query for second-highest salary using LIMIT, OFFSET, or ROW_NUMBER()

SQLeasy0.3 min read
Nihilent
β†’
456

Write a query that identifies numbers appearing at least three times consecutively without interruption

SQLeasy0.3 min read
JP Morgan
β†’
457

Write a query that ranks users by their total order amount within each region.

SQLmediumpartition0.2 min read
Cognizant
β†’
458

Write a query to calculate Monthly Active Users (MAUs) for July 2022

SQLmediumpartition0.2 min read
NASDAQ
β†’
459

Write a query to calculate the day's difference between the 1st and 3rd sales of the CustomerName = 'Alice Johnson'.

SQLmediumpartition0.3 min read
Grover
β†’
460

Write a query to calculate the total revenue generated by each product category.

SQLmediumjoin0.2 min read
Adidas
β†’

Reading isn't practice. Get AI feedback on your answers.

Type or paste your answer to any of these questions and our AI Coach scores it, highlights gaps, and rewrites it at FAANG quality. Free to try.

Try AI Answer Coach β€” FreeStart a Mock Interview
Previous1...2122232425Next
Categories
All QuestionsSQLSpark / Big DataPython / CodingSystem DesignCloud / ToolsBehavioral
By Company
AmazonGoogleDatabricksSnowflakeMicrosoftNetflixUberTCS
Interview Guides
All GuidesTop SQL QuestionsTop Spark QuestionsTop Python QuestionsTop System DesignSQL Window FunctionsETL QuestionsData Modeling
Products
AI Interview CoachAnswer AnalyzerSQL PlaygroundResume AnalyzerInterview PacksPricing
Company
About UsContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
Β© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer