Technical Skills

SQL and Data Querying Test

Assess SQL knowledge across joins, filtering, aggregation, database structure and data querying.

45 minMedium15 questions15 sections
SQL joinsAggregationsFilteringDatabase structure

Topics covered

Joins and AggregationLatest RecordRunning TotalsCohort AnalysisIndexingExecution PlansTransactionsUpsertsNULL SemanticsDeduplicationPaginationIsolation LevelsSchema EvolutionResult ValidationQuery Review

Sample questions

A preview from the supplied content for this template. Use it as a reference when building your test.

Joins and AggregationMid-level

Schema: customers(id, name) orders(id, customer_id, total, status) order_items(id, order_id, product_id, quantity) A report must return every customer, including customers with no orders, and their paid_order_revenue. A first attempt joins all three tables and produces inflated revenue. Write the query and explain why the first attempt duplicates totals.

Latest RecordMid-level

Schema: subscription_events(customer_id, event_time, status, event_id) Return the latest status for each customer. Events can share the same event_time. Write a deterministic query and explain the tie-breaker.

Running TotalsMid-level

Schema: transactions(account_id, occurred_at, transaction_id, amount) Return every transaction with the account's running balance ordered by time. Multiple transactions may share a timestamp.

Cohort AnalysisMid-level

Design a SQL approach for monthly signup cohorts and month-0 to month-6 active-user retention. Define the cohort, activity event, denominator and treatment of users with insufficient observation time.

The supplied content includes 11 more questions.

Use SQL and Data Querying Test as your starting point.

Review this preview, then create a test that matches your candidates, employees or learners.

Use This Template