πŸͺ

Essential cookies keep authentication working. With your permission, we also use analytics to improve the product. Privacy Policy

DDataEngPrep.tech
Home
PricingBlog
Sign InStart Free→

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.

SQLmediumpartitionsqlwindow2 min read
AccentureYash Technologies
β†’
25

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

SQLmediumjoin2 min read
PresidioSwiggy
β†’
26

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

SQLmediumjoin2 min read
PresidioSwiggy
β†’
27

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

SQLmediumetljoin2 min read
PresidioSwiggy
β†’
28

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

SQLmedium2 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?

SQLmediumbigquerysnowflake2 min read
ChryselysEY
β†’
33

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

SQLmediumpartitionsql2 min read
FedEx DataworksIncedo
β†’
34

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

SQLmediumpartitionwindow2 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

SQLmediumpartitionsparksql1 min read
Presidio
β†’
37

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

SQLmediumpartition2 min read
Freight Tiger
β†’
38

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

SQLmediumjoin1 min read
HashedIn
β†’
39

Add a new column with the average salary by department.

SQLmediumpartitionwindow1 min read
HashedIn
β†’
40

Calculate the cumulative transaction amount for each month using a transaction table.

SQLmediumpartition2 min read
Bitwise
β†’

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...6Next
Topic Hubs
All Topic Hubs (12 Competencies) β†’All 1,863+ QuestionsSQL Interview QuestionsApache Spark QuestionsPySpark QuestionsPython for Data EngineersSystem Design InterviewData Modeling & WarehousingStreaming (Kafka/Flink)SQL Window FunctionsETL Pipeline Design
Company Hubs
All Company Hubs (100+ Companies) β†’AmazonGoogleMetaDatabricksSnowflakeNetflixUberStripeMicrosoftAppleGoldman SachsAWS Engineering
Academies & Guides
All Guides & ArticlesData Engineering AcademyForward Deployed AI AcademyClient Simulation StudioApache Airflow QuestionsAzure Data EngineerBehavioral & STAR MethodCloud & Distributed Tools
AI Tools & Products
Answer Analyzer (Free)AI Mock InterviewsSQL PlaygroundATS Resume AnalyzerOffline PDF Answer VaultsMembership & Pricing
Company
About & Editorial PolicyContact UsAI DisclosureDisclaimerTerms of ServicePrivacy Policy
Β© 2026 DataEngPrep.tech. All rights reserved.
AboutBlogContactDisclaimer