SQL Interview Questions
Practice SQL interview questions from top companies. Filter by difficulty, role, and SQL concept.
All SQL Questions
Write SQL for reply-based recipient metrics
Write SQL for repeat churn
Calculate Cohort Retention
Write SQL for call metrics
Find high-value crypto users and top CTR
Write SQL for top categories and highly active users
Compute Cohort Retention Rate
Explain Pandas and SQL Basics
Write SQL for DAU and first-purchase conversion
Analyze advertiser spend by source
Handle repeated churn in SQL
Calculate Pirated Usage and Revenue Loss
Differentiate pandas objects and SQL filters
Analyze video flags and reviews with SQL
Find high-value crypto users and top-CTR product
Query departments and top earners
Train and analyze a classifier
Pivot daily users and revenue by platform
Debug row loss after SQL joins
Find top category by video time spent
Write SQL for monthly spend and ratios
Find least active countries
Write SQL for seller and vehicle metrics
Compute article-type diversity per user and histogram
Write SQL to compute signup and retention lift
Write SQL for call analytics
Aggregate D1 retention cohorts in SQL
Write SQL for percent and window changes
Write SQL window functions for D7 retention
Debug ML pipeline and build text parser
Write Call Analytics SQL Queries
Find recommended friend pairs by shared songs
Debug and harden trial-assignment Python code
Debug SQL join that drops rows
Explain pandas and SQL basics
Write SQL for video-call recipients and FR activity
Write SQL and Python for transaction analytics
Analyze spend cohort and source shifts
Find top-paid employee per department
Analyze Multiple-Account Users in SQL
Write SQL for CTR and revenue
Compute this-year spend share of last-year whales
Detect sessions and gaps using SQL LEAD
Implement a nested object validator
Compute each member’s current notification status
Convert Dictionary to DataFrame
Compute percent of first-cancelled users who never rebook
Transform DataFrame and compute diff-in-diff
Write SQL for rankings, state, and aggregations
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.