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 video-call recipients and FR activity
Write SQL for repeat churn
Calculate Pirated Usage and Revenue Loss
Write SQL for monthly spend and ratios
Debug ML pipeline and build text parser
Transform DataFrame and compute diff-in-diff
Debug and harden trial-assignment Python code
Write SQL to compute signup and retention lift
Write SQL for CTR and Revenue
Pivot daily users and revenue by platform
Write SQL to compare social-only vs game-only engagement
Write SQL for late-delivery metrics by window
Compute Fitness App DAU
Implement vectorized NumPy ops and explain broadcasting
Compute video-call SQL metrics with edge cases
Write SQL for percent and window changes
Find high-value crypto users and top CTR
Handle repeated churn in SQL
Analyze time-zoned events with pandas
Implement a nested object validator
Write SQL for content-view analytics
Calculate Cohort Retention
Compute reply-based user metrics in 7 days
Write SQL for retention, conversion, and churn
Compute C/T metrics from bookings and visits
Query US-based users and most active forums
Train and analyze a classifier
Write SQL for influence score and follower growth
Compute monthly signups, conversion, and YoY growth
Write SQL for cuisine median delivery times
Implement paginated API ingestion
Measure Late Deliveries and Identify Top Delayed Restaurants
Compute daily active ads
Find high-value crypto users and top-CTR product
Compute monthly CRR with merges and gaps
Write SQL for DAU and first-purchase conversion
Find orders from bottom-quartile revenue restaurants
Analyze document collaboration patterns
Determine Maximum Consecutive Order Days Per User
Write SQL for content view metrics by device
Refactor SQL into an aggregated report
Write SQL for fares and age-band counts
Recommend two-hop follows in Python
Analyze member video posting behavior by country
Find top-5 most similar rows across datasets
Aggregate D1 retention cohorts in SQL
Compute unread and multi-account user percentages
Tackle Python tasks under time pressure
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.