DataEngPrep.tech
QuestionsPracticeAI CoachDashboardPacksBlog
ProLogin

Interview Questions

Real questions from top companies in SQL Β· medium

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

How do you handle NULL values in SQL? Mention functions like COALESCE and ISNULL.

SQLmediumjoinsql0.5 min read
AareteDunnhumbyIncedo
β†’
22

How would you handle duplicate records in an SQL table?

SQLmediumpartitionsql0.6 min read
AareteDunnhumbyIncedo
β†’
23

Implement a query to find the top 5 customers by total sales amount.

SQLmediumpartitionwindow0.5 min read
Daniel WellingtonGoldman SachsSwiggy
β†’
24

SQL query to find the second highest salary from each department.

SQLmediumpartitionsqlwindow0.4 min read
AccentureYash Technologies
β†’
25

What are primary keys and foreign keys? Why are they important?

SQLmediumjoin0.4 min read
PresidioSwiggy
β†’
26

What is a self-join, and when would you use it?

SQLmediumjoin0.4 min read
PresidioSwiggy
β†’
27

What is normalization and denormalization? When would you use each?

SQLmediumetljoin0.4 min read
PresidioSwiggy
β†’
28

What is the difference between a view and a materialized view?

SQLmedium0.4 min read
PresidioSwiggy
β†’
29

Write an SQL query to find duplicate emails in a users table.

SQLmediumpartitionsqlwindow0.5 min read
Daniel WellingtonGoldman SachsSwiggy
β†’
30

Triggers in ADF, especially tumbling window triggers.

SQLmediumpartitionwindow0.5 min read
AccentureYash Technologies
β†’
31

What is a window function? Explain with an example.

SQLmediumjoinpartitionwindow0.5 min read
CitiFreecharge
β†’
32

What is the difference between OLTP and OLAP?

SQLmediumbigquerysnowflake0.4 min read
ChryselysEY
β†’
33

Write a SQL query to find top 3 earners in each department.

SQLmediumpartitionsql0.4 min read
FedEx DataworksIncedo
β†’
34

Write a query to find the top three highest-paid employees in each department using window functions.

SQLmediumpartitionwindow0.4 min read
Bristol Myers SquibbWipro
β†’
35

Write complex SQL queries involving multiple joins, subqueries, and data aggregation logic.

SQLmediumjoinpartitionsql0.7 min read
AppleTiger Analytics
β†’
36

Add Row Numbers using window function in PySpark

SQLmediumpartitionsparksql0.2 min read
Presidio
β†’
37

Add a column to the Employees table that shows the name of the employee with the next higher employee_id.

SQLmediumpartition0.2 min read
Freight Tiger
β†’
38

Add a new column with manager names for each employee using a self-join.

SQLmediumjoin0.2 min read
HashedIn
β†’
39

Add a new column with the average salary by department.

SQLmediumpartitionwindow0.2 min read
HashedIn
β†’
40

Advanced SQL with CTEs and Conditional Joins

SQLmediumjoinpartitionsql0.3 min read
Myntra
β†’

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
Previous1234...14Next
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