SQL Interview Questions
Practice SQL interview questions from top companies. Filter by difficulty, role, and SQL concept.
All SQL Questions
Count Recent High-Volume Call Users
Write SQL for repeat churn
Write SQL for video-call recipients and FR activity
Debug and harden trial-assignment Python code
Compute Fitness App DAU
Calculate Cohort Retention
Transform DataFrame and compute diff-in-diff
Write SQL for percent and window changes
Write SQL for CTR and Revenue
Train and analyze a classifier
Write SQL for late-delivery metrics by window
Calculate Pirated Usage and Revenue Loss
Debug ML pipeline and build text parser
Write SQL to compare social-only vs game-only engagement
Implement vectorized NumPy ops and explain broadcasting
Write SQL for monthly spend and ratios
Analyze time-zoned events with pandas
Handle repeated churn in SQL
Find high-value crypto users and top CTR
Compute monthly signups, conversion, and YoY growth
Write SQL and Python for transaction analytics
Write SQL for content-view analytics
Pivot daily users and revenue by platform
Compute video-call SQL metrics with edge cases
Compute C/T metrics from bookings and visits
Write SQL to compute signup and retention lift
Write SQL for retention, conversion, and churn
Compute monthly CRR with merges and gaps
Compute reply-based user metrics in 7 days
Write SQL for DAU and first-purchase conversion
Analyze spend cohort and source shifts
Write SQL for cuisine median delivery times
Analyze document collaboration patterns
Measure Late Deliveries and Identify Top Delayed Restaurants
Write SQL for influence score and follower growth
Query US-based users and most active forums
Write SQL for Pixel Signal Metrics
Compute churn with re-subscriptions
Use pandas to aggregate, pivot, and label
Query departments and top earners
Compute percent of active users with 50+ calls
Count weekly customers with ≥$1000 YTD spend
Write SQL for fares and age-band counts
Tackle Python tasks under time pressure
Select Top Customers Using Transaction Data Filters
Recommend two-hop follows in Python
Determine Maximum Consecutive Order Days Per User
Analyze member video posting behavior by country
Write SQL for call analytics
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.