SQL questions from Swiggy data engineering interviews.
These sql questions are sourced from Swiggy data engineering interviews. Each includes an expert-level answer.
Describe a scenario where partitioning and bucketing would improve query performance.
Difference between ROW_NUMBER(), RANK(), and DENSE_RANK() with examples.
Difference between where and having clause with examples.
Explain the difference between UNION and UNION ALL.
Implement a query to find the top 5 customers by total sales amount.
What are primary keys and foreign keys? Why are they important?
What is a self-join, and when would you use it?
What is normalization and denormalization? When would you use each?
What is the difference between a clustered and non-clustered index?
What is the difference between a view and a materialized view?
What is the difference between DELETE and TRUNCATE?
Write an SQL query to find duplicate emails in a users table.
Compare the star schema and snowflake schema. Which one would you use for reporting at Swiggy, and why?
Describe a situation where you prioritized business needs over technical elegance. How did you manage trade-offs?
How do you handle NULL values in a SQL query to avoid incorrect results?
How do you secure sensitive customer data in a data warehouse?
How would you design a data model for an e-commerce platform?
Optimize a slow SQL query for a large orders table containing billions of rows.
What are Slowly Changing Dimensions (SCD), and how would you implement them for tracking customer data changes?
Write a SQL query to find the top 5 most ordered dishes in the last 30 days.
Write a query to identify duplicate customer entries based on email and phone number.
Download the complete interview prep bundle with expert answers. Study offline, on your commute, anywhere.