SQL Interview Questions
Practice SQL interview questions from top companies. Filter by difficulty, role, and SQL concept.
All SQL Questions
Analyze Returning Borrowers Across Two Days of Logs
Measure Customers Ordering from Bottom-Quartile Restaurants
Find Each User's Earliest Seven-Day Activity Streak
Calculate the Monthly Share of High-Frequency Customers
Implement and Evaluate Pin Similarity in Python
Find Monthly Top Customers Excluding High-Frequency Users
Describe How You Use SQL in Data Science Work
Calculate Monthly Restaurant Sales Growth
Analyze a Regression Dataset and Build a Safe File-Processing Utility
Describe Your Analysis and Visualization Toolkit
Analyze User Ride Activity with SQL
Find A Low-Quality Annotator From Label Data
Compare Survey Satisfaction for New and Established Users
Answer SQL And Data Warehouse Fundamentals For A Data Engineering Interview
Compute Company Suggestion Funnels
Implement a Safe Average Function in Python
Debug ML pipeline and build text parser
Monthly Cohort Retention
Analyze member video posting behavior by country
Transform and aggregate messy event data
Top 5 Most Efficient Vehicle Models
Debug and harden trial-assignment Python code
Write SQL window functions for D7 retention
Calculate Daily Survey Response Rates by Country
Query US-based users and most active forums
Build a Gap-Free Monthly Booking Summary
Analyze Pirated Theme Usage
Train and analyze a classifier
Implement vectorized NumPy ops and explain broadcasting
Calculate CTR and ad revenue
Compute Heavy-Caller Percentages
Analyze Thirty-Day Ad Performance with SQL
Implement a robust Python generator
Debug row loss after SQL joins
Compute a Seven-Day Rolling Average
Solve SQL and Python OA tasks
Implement paginated API ingestion
Compute a Rolling Seven-Day Revenue Sum with Missing Dates
Compute signup rate and retention from raw logs
Compute Fitness App DAU
Query Top Played Tracks Globally And By Country
Write SQL for repeat churn
Implement robust word counts and min/max
Clean scores and return top 5 students
Handle repeated churn in SQL
Campaign Efficiency Metrics and Below-Average CTR
Find the Highest-Paid Employee in Each Department
Query departments and top earners
Measure Daily Late-Order Rates by Delivery Zone
How to Prepare for SQL Interviews
SQL interviews for data analyst, data scientist, and software engineering roles focus heavily on your ability to write efficient queries and understand relational database concepts. Success requires mastering both fundamental syntax and advanced techniques that appear frequently in real interviews.
Master the Core Concepts
Start with JOINs, window functions, CTEs, and aggregations - these form the foundation of most interview questions. Understanding when to use INNER JOIN versus LEFT JOIN, or knowing the difference between ROW_NUMBER() and RANK(), will help you solve 80% of SQL interview problems.
Common Patterns You'll See
Companies like Meta, Google, and Amazon frequently test specific patterns: Top-N per group, deduplication, rolling metrics, retention cohorts, funnel conversion, and sessionization.
Practice with Real Company Questions
The best way to prepare is practicing questions from your target companies. Use the company filter above to practice relevant questions.