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.
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.
Which window function gives a dense ranking that handles ties without skipping ranks?
- A.ROW_NUMBER()
- B.RANK()
- C.DENSE_RANK()
- D.PERCENT_RANK()
Given `events(user_id, event_name, created_at)`, write a query that returns for each user the days between their first and last event.
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%
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.
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.
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.
Related assessment templates
Other role-specific templates you might want to customize.
Launch Your SQL Analyst Assessment Today
Customize this template and invite candidates in minutes.