SQL Analyst Assessment Template

A ready-to-run SQL analyst hiring test covering window functions, CTEs, analytical queries, and data investigation — on real seeded data.

Duration
45 minutes
Questions
8
Level
Mid-Level
Passing Score
70%

What this template measures

Every skill needed for a sql analyst hire, covered across MCQ, coding, and essay questions.

Joins & Subqueries

Inner, outer, cross joins, correlated subqueries.

Window Functions

ROW_NUMBER, RANK, LAG/LEAD, framing.

CTEs

Recursive CTEs, multi-stage query refactors.

Aggregation

GROUP BY, HAVING, CUBE/ROLLUP.

Data Investigation

Finding outliers, cohort analysis, funnels.

Query Performance

Index awareness, N+1 avoidance, query plans.

Sample questions from this template

A preview of the questions you'll see when you use this template.

Multiple ChoiceMediumQuestion 1

Which window function gives a dense ranking that handles ties without skipping ranks?

  • A.ROW_NUMBER()
  • B.RANK()
  • C.DENSE_RANK()
  • D.PERCENT_RANK()
CodingMediumSQLQuestion 2

Given `events(user_id, event_name, created_at)`, write a query that returns for each user the days between their first and last event.

CodingHardSQLQuestion 3

Build a cohort retention analysis: - Cohort by signup month - Retention measured by any event in the product - Return: cohort_month, months_since_signup, retained_pct - Normalize so each cohort's month 0 is 100%

CodingHardSQLQuestion 4

Given `orders(id, user_id, amount, created_at)`, write a query to identify the top 5 customers by 30-day rolling revenue for each day in the past 90 days. Single query using window functions.

EssayMediumQuestion 5

A query that runs in 50ms on dev runs in 30s on prod. Walk through how you'd investigate.

Scoring rubric

How candidates are evaluated on this template.

Dimension
Description
Weight
Correctness
Queries return exactly the right results.
50%
Query Efficiency
Uses window functions and CTEs appropriately.
25%
Analytical Reasoning
Understands the business question behind the query.
15%
Readability
Uses CTEs for clarity, names aliases well.
10%

Frequently asked questions

Which SQL dialect is used?+

PostgreSQL 15 by default. Variants for BigQuery, Snowflake, Redshift, and MSSQL available.

Can I customize this template?+

Yes. Every question, time limit, weighting, and rubric dimension is fully editable. Use the template as a starting point and tailor it to your role and seniority level.

Does this template include AI cheat detection?+

Yes. All ClarityHire assessment templates ship with code coherence AI, keystroke biometrics, and paste detection enabled by default. You can dial integrity level per role.

Can candidates see sample questions before starting?+

Yes. Each template supports unscored practice questions so candidates warm up before the real assessment begins. That way you measure skill, not test anxiety.

Launch Your SQL Analyst Assessment Today

Customize this template and invite candidates in minutes.