practice a little every day — you've got this ♡
SQL Interview Problems
Practice 5971 original coding, SQL, system design, machine learning and behavioral problems across 15 topics. Coding and SQL problems run against hidden test cases right in your browser; every problem has hints and a worked solution, free.
- 5971
- Problems
- 2211
- Auto-graded
- 15
- Topics
- 272
- Added today
Showing 61–90 of 100 results
- SQL & DataMediumAuto-gradedAggregate Transactions by Country for Most Recent Active Period
Tests date handling, filtering, and grouped aggregation to find the latest month with successful records and summarize by region.
SQL & Dataaggregationdate-manipulationfiltering - SQL & DataMediumAuto-gradedUser Signup and Follower Metrics Report
Simulate three SQL analytics queries in Python: total users, busiest signup month (with tie-break), and the most-followed usernames including ties.
SQL & Dataaggregationgroupingcountingties - SQL & DataMediumAuto-gradedWeekly Cohort Activity Retention Analysis
Group users by signup week, compute seven-day activity retention rates, and handle zero-retention cohorts correctly.
SQL & Datadata-analysiscohort-analysisretentionaggregation - SQL & DataMediumAuto-gradedClassify Risky Transactions and Dispute History
Tests multi-window aggregation, business-rule encoding, and precise date/time boundary handling across three related data tables.
SQL & Datadata-manipulationdatetimebusiness-rules - SQL & DataMediumAuto-gradedConditional Sum Aggregation with Group Filtering
Compute filtered totals two ways and group-then-threshold results, mirroring SQL conditional aggregation semantics.
SQL & Dataconditional-aggregationgroupingsimulationpython - SQL & DataMediumAuto-gradedReconcile Ledger and Bank Snapshots for a Month
Join two per-month balance datasets on account id, classify each account as match, mismatch, or missing on one side, handling true zero balances correctly.
SQL & Datahashingjoindata-manipulationedge-cases - SQL & DataMediumAuto-gradedDistinct Content Categories per Reader
Tests two-level aggregation: counting distinct content categories per reader on a target date, then bucketing those counts into a frequency histogram across all dates.
SQL & Datagroupingaggregationhistogramhashing - SQL & DataEasyAuto-gradedCo-Access Analytics on Document Usage Logs
Tests data deduplication, self-joins, metric definition, and grouped aggregation over access logs with user metadata.
SQL & Datadata-manipulationaggregationjoinsdeduplication - SQL & DataMediumAuto-gradedMonthly Revenue Summary by Product Category
Tests group-by aggregation over a list of transaction records to compute per-category monthly revenue, count, and average order value.
SQL & Datagroup-by aggregationdata cleaningdictionaries - SQL & DataMediumAuto-gradedDaily Session Starters: Count Users Who Opened the App First
Tests window-function thinking, tie-breaking logic, and grouped aggregation by finding users whose very first recorded action each day was opening the app.
SQL & Datasimulationhash-mapsorting - SQL & DataMediumAuto-gradedCarrier Defect Metrics and High-Risk Shipping Routes
Aggregating shipment quality metrics by carrier and time period, computing period-over-period changes, and ranking routes by defect frequency.
SQL & Dataaggregationjoinswindow-functionsdata-analysis - SQL & DataMediumAuto-gradedCalculate Engaged User Percentage by Region
Classify users as engaged based on activity frequency and device diversity, then compute the engaged-user rate per region.
SQL & Datadata-manipulationaggregationfiltering - SQL & DataMediumAuto-gradedMulti-Year Sales Analysis by Customer Demographics
Tests data joining, deduplication, cohort segmentation, conditional aggregation, and percentage calculations across multiple tables.
SQL & Datadata-manipulationaggregationcohort-analysis - SQL & DataMediumAuto-gradedTop 5 Delivery Routes by Fuel Efficiency
Tests aggregating trip data across two tables, guarding against division by zero, and ranking results with a deterministic tie-break.
SQL & Dataaggregationfilteringsorting - SQL & DataMediumAuto-gradedTop Destination by Clear-Day Frequency
Tests grouping, filtering categorical records, and correctly handling ties when aggregating a frequency count across multiple keys.
SQL & Dataaggregationgroupingfilteringdictionaries - SQL & DataMediumAuto-gradedRolling-Window Post Engagement: Reach, Length Percentiles, Self-Replies
Tests SQL/Python analytics skills: filtering soft-deleted records, distinct-count aggregation, linear-interpolation percentiles, time-windowed grouping, and tie-breaking sort logic.
SQL & Datasqlaggregationpercentiles - SQL & DataMediumAuto-gradedRegional Notification Performance Summary
Tests join, filter, and conditional aggregation logic to compute per-region metrics with threshold filtering and safe division.
SQL & Dataaggregationjoinsconditional-logicdata-analysis - SQL & DataMediumAuto-gradedHighest Revenue Product per Category with Returns
Tests data aggregation, join logic, net-revenue calculation accounting for returns, and ranking with tie-breaking.
SQL & Dataaggregationjoinsrankingwindow-functions - SQL & DataEasyAuto-gradedCompute Running Departmental Budget Consumed
Tests ability to implement window-style running totals by computing each row's cumulative spend within its department, ordered by date then transaction ID.
SQL & Datawindow functionsrunning totalsdata processing - SQL & DataMediumAuto-gradedAggregating Safety and Activity Metrics Across Multiple Entities
Tests proficiency in multi-table aggregation, ratio computation, windowed moving averages, and handling edge cases with missing data.
SQL & Dataaggregationjoinswindow-functionsdata-analysis - SQL & DataEasyAuto-gradedSocial Media Reply Analytics
Analyzes reply patterns in social media data using temporal filtering, joins, and aggregation to compute engagement metrics.
SQL & Datadata-analysisaggregationfiltering - SQL & DataMediumAuto-gradedDeduplicate and Reconcile Customer Records
Tests the ability to clean a list of messy customer records by deduplicating on a canonical key, resolving field conflicts with explicit priority rules, and returning a sorted, normalized result.
SQL & Datadata cleaningdeduplicationaggregation - SQL & DataMediumAuto-gradedCompute Running Department Salary Budget with Resets
Tests the ability to implement window-style running totals that accumulate within groups and reset at group boundaries, mimicking SQL's SUM() OVER (PARTITION BY ... ORDER BY ...).
SQL & Datawindow functionsrunning totalsdata processing - SQL & DataMediumAuto-gradedFind Most Similar Item Collections
Tests set operations, pairwise comparison, and tie-breaking logic to identify the pair of collections with maximum item overlap.
SQL & Datasetssimilarity-metricsdata-manipulation - SQL & DataMediumAuto-gradedAggregate Sales Report from Transaction Records
Tests the ability to perform group-by aggregation (sum, count, average) over a list of dicts, mimicking SQL GROUP BY with multiple metrics and tie-breaking output order.
SQL & Datagroup-by aggregationdata cleaninglist of dicts - SQL & DataEasyAuto-gradedSummarize Monthly Sales by Region from Transaction Records
Tests group-by aggregation: given a list of transaction dicts, compute total revenue and order count per region per month, returned as a sorted list of summary records.
SQL & Datadata aggregationdictionariessorting - SQL & DataMediumAuto-gradedSequence Numbering Within Grouped Records
Tests ability to assign sequential positions to records within partitions using sorting and grouping logic.
SQL & Datawindow-functionssortinggrouping - SQL & DataMediumAuto-gradedDay-7 User Activity Counter
Identify users who recorded at least one activity exactly seven calendar days after joining.
SQL & Datadata-analysisdate-manipulationset-operations - SQL & DataMediumAuto-gradedRanking Actors by Film Count in a Unified Object Database
Tests filtering credits by role, deduplicating person-movie pairs, validating object types in a shared ID space, and applying a deterministic tie-breaking policy.
SQL & Datadata-aggregationfilteringdeduplication - SQL & DataMediumAuto-gradedBuild a Deterministic Top-10 Leaderboard with Tie-Breaking
Tests your ability to produce a fixed-size ranked list when scores contain ties, using a stable secondary sort key.
SQL & Datarankingsortingtie-breakingleaderboard