NEW: The Blockchain Data Engineering Guide is out →NEW: The Blockchain Data Engineering Guide is out →
Back to blog
best sql practice sitesbest sql practice sites for data analyst interviewsfree sql practice sitesleetcode vs stratascratch vs datalemurblockchain sql practicewizardcamp

Best SQL Practice Sites in 2026: LeetCode, DataLemur, StrataScratch and WizardCamp

Vincent Charles

Vincent Charles

November 4, 2026 · 13 min read

Best SQL Practice Sites in 2026: LeetCode, DataLemur, StrataScratch and WizardCamp

The best SQL practice sites in 2026 are LeetCode for a short interview drill, DataLemur and StrataScratch for questions modeled on real company interviews, HackerRank and SQLZoo for free fundamentals, and Dune or WizardCamp if you want a job that touches blockchain data. The right one depends on the interview you are preparing for, not on which site has the most questions.

This guide compares eight SQL practice sites on what actually matters: the data you query, the feedback you get, and what is free. Then it shows three exercises that no generic site can give you, because they depend on how blockchains store data. If you are aiming at crypto data roles, you can practice them in WizardCamp, our blockchain SQL course, with instant feedback on every query.

TL;DR:

  • For generic interviews: LeetCode SQL 50, DataLemur and StrataScratch cover the classic analyst patterns. Pick one and finish it.
  • For free fundamentals: SQLZoo, HackerRank and sql-practice.com teach SELECT, joins and aggregation in the browser at no cost.
  • For crypto roles: generic sites never teach token accounts, decimals or wallet cohorts. Dune gives you real data, WizardCamp adds instant feedback.
  • Our data: 60% of the 363 live data roles on the Unchain Data job board mention SQL, and none name a practice platform.
  • Best plan: drill patterns on one generic site, then rebuild them on real onchain tables.

What are the best SQL practice sites?

The best SQL practice sites are the ones that match your next interview. For most data analyst interviews, that means a site with interview style questions and a grader: LeetCode, DataLemur or StrataScratch. For learning the basics for free, SQLZoo, HackerRank and sql-practice.com are enough. For crypto, DeFi and Web3 data roles, you need practice on real blockchain tables, which only Dune and WizardCamp offer.

Here is how the eight sites compare.

SiteBest forData you queryFeedbackFree option
LeetCodeA one month interview drillSmall synthetic tablesAuto judgedFree account, some questions need Premium
DataLemurData analyst and data science interviewsSynthetic tables based on company interview questionsAuto judged, hints and solutionsFree questions, paid Premium
StrataScratchLarge question bank, SQL and PythonInterview datasetsAuto judgedFree start, no credit card
HackerRankFundamentals by topicSmall synthetic tablesScored challengesFree
SQLZooTotal beginnersPublic datasets (world, Nobel, elections)Checked answersFree
sql-practice.comQuick browser practiceA hospital databaseValidated on every runFree
DuneReal onchain data, public portfolioFull mainnet tablesNone, you check yourselfFree tier
WizardCamp (blockchain SQL course)Crypto data analyst rolesSamples of real Dune tables, Ethereum and SolanaInstant feedback on every query9 free exercises

The generic SQL practice sites, compared

LeetCode: best for a short, focused drill

LeetCode's SQL 50 study plan is 50 essential questions from basic to intermediate, designed for about a month of preparation. It is the most structured way to cover joins, aggregation, subqueries and window functions in a fixed order. The tables are small and abstract (employees, logins, orders), so you learn the patterns, not the data.

DataLemur: best for data analyst interview questions

DataLemur was built by Nick Singh, author of Ace the Data Science Interview, as an interactive way to practice SQL and analytics interview questions. In our November 1 Google check it ranked first for best SQL practice sites for data analyst interviews, and it publishes company specific question sets, including Coinbase SQL interview questions about crypto purchases and active buyers. Those questions run on clean, simplified tables, not on chain data.

StrataScratch: best for volume and Python alongside SQL

StrataScratch lists more than 1,000 real coding and concept questions for data science, machine learning and AI engineering interviews, in SQL and Python, plus mock interviews and take home projects. It suits candidates who need both languages, or who want to grind a large bank.

HackerRank, SQLZoo and sql-practice.com: best free fundamentals

HackerRank's SQL track splits challenges by subdomain (basic select, aggregation, basic and advanced joins) and difficulty. SQLZoo walks you step by step from SELECT basics to joins, self joins and window functions on public datasets. sql-practice.com gives you a hospital database and checks your answer every time you run a query. All three are free, and any one of them is enough to learn the syntax.

LeetCode vs StrataScratch vs DataLemur

If you only have time for one: LeetCode for structure, DataLemur for analyst style questions with good explanations, StrataScratch if your interviews include Python. All three teach the same core patterns: aggregation, joins, top N per group, running totals and retention. What none of them teach is the data a crypto company will put in front of you.

Why generic practice sites are not enough for crypto data roles

Generic sites teach SQL. Crypto interviews test SQL on blockchain data, where the traps are in the data model, not the syntax: a token has decimals, a Solana wallet holds tokens through separate token accounts, failed transactions still pay gas, and the first time you see a wallet is not the first time it existed.

The demand is real. As of November 1, 2026, the Unchain Data job board lists 363 live data roles at 125 companies, across analyst, engineer, scientist, head of data, research and compliance roles:

  • 217 of them (60%) mention SQL. For data analyst roles alone, it is 47 of 63 (75%).
  • 106 (29%) mention onchain or blockchain data, and 65 ask for both SQL and onchain data.
  • None of the 363 name LeetCode, HackerRank, StrataScratch or DataLemur. Employers do not care where you practiced. They care whether you can query their tables.

You can browse the live roles on the Web3 data analyst job board. The three exercises below show the gap between a generic SQL question and an onchain one.

3 onchain SQL exercises you will not find on generic sites

Each exercise is a real WizardCamp exercise, with the actual question, the reference solution and the real result. The data is a documented sample of a real Dune table.

Exercise 1: Find each wallet's first transaction

From WizardCamp's Ethereum Blockchain Fundamentals module ("First Transaction Per Wallet", Ethereum path).

SQL concept: ROW_NUMBER() OVER (PARTITION BY ...) and filtering in an outer query. Dune table: ethereum.transactions.

This is the onchain version of the first login per user question every generic site has. Return each wallet's earliest transaction, with its hash, time and block.

WITH ranked AS (
  SELECT
    from_address,
    tx_hash,
    block_time,
    block_number,
    ROW_NUMBER() OVER (
      PARTITION BY from_address
      ORDER BY block_time, tx_hash
    ) AS rn
  FROM transactions
)
SELECT
  lower(hex(from_address)) AS from_address,
  lower(hex(tx_hash))      AS tx_hash,
  block_time,
  block_number
FROM ranked
WHERE rn = 1
ORDER BY block_number ASC, from_address ASC

The sample holds 12 wallets with two or three transactions each, from blocks 19000000 to 19000049 on January 13, 2024. The query returns exactly 12 rows, from block 19000001 to block 19000032. The first one is wallet 0x008f3f65823f5d43e7c79b9c3f652452ef23517b, at 19:17:35 UTC in block 19000001.

The lesson: the tx_hash tiebreaker matters, because several transactions from one sender can land in the same block with the same block_time. Without it, the first transaction is not deterministic and your result can change between runs. And on a real chain, first in your dataset is only first ever if your data starts at genesis. On Dune, the columns are "from" and "hash", quoted because both are reserved or overloaded keywords.

Exercise 2: Count the holders of a Solana token

From WizardCamp's SPL Tokens and the Accounts Model module ("Count the Holders of a Token", Solana path).

SQL concept: COUNT(DISTINCT ...) with the right filter. Dune table: solana_utils.latest_balances.

Count the wallets holding a positive balance of one token, mint nmHW2MM5PziaJG1K7wxuHCpJHVPCcV7jVf9kyFehTbE.

SELECT count(DISTINCT token_balance_owner) AS holders
FROM token_holder_accounts
WHERE token_mint_address = 'nmHW2MM5PziaJG1K7wxuHCpJHVPCcV7jVf9kyFehTbE'
  AND token_balance > 0

The seed is the mint's complete account set as of September 21, 2026, 07:01:21 UTC: 3,188 token accounts. The correct answer is 76 holders.

The lesson: there are three tempting answers and two are wrong. Counting rows gives 3,188, but those are token accounts, not wallets. Counting distinct owners without the balance filter gives 3,187, because almost every account belongs to a different wallet. Only 76 owners, about 2.4%, still hold a positive balance. On Solana a wallet holds tokens through separate token accounts that stay open at zero, so a holder count without token_balance > 0 measures who ever touched the token, not who holds it.

Exercise 3: Split weekly traders into new and returning

From WizardCamp's DEXs, Venues and Volume module ("New vs Returning Traders per Week", Solana path).

SQL concept: a first seen CTE joined back to activity, with count_if. Dune table: dex_solana.trades.

New versus returning users is a staple of product analytics interviews. Here the users are Solana DEX traders, and each row is one trader active in one week.

WITH first_week AS (
  SELECT trader_id, min(week_start) AS first_week
  FROM trader_weeks_sample
  GROUP BY trader_id
)
SELECT
  w.week_start,
  count(*) AS traders,
  count_if(w.week_start = f.first_week) AS new_traders,
  count_if(w.week_start > f.first_week) AS returning_traders
FROM trader_weeks_sample w
JOIN first_week f ON f.trader_id = w.trader_id
GROUP BY w.week_start
ORDER BY w.week_start

The sample is a 1 in 10,000 hash sample of traders from dex_solana.trades, August 1 to 30, 2026: 1,320 trader weeks from 944 distinct traders.

week_starttradersnew_tradersreturning_traders
2026-07-2799990
2026-08-0325620749
2026-08-1022013387
2026-08-1735025199
2026-08-24395254141

The lesson: the first row is a trap. The window starts on Saturday, August 1, so the week of July 27 holds only two days and is 100% new by construction, because nothing can come before the window. New also means new to this window, not new to Solana: a trader active in July shows up as new in August. And the new column sums to 944, the number of distinct traders, which is a quick check that you classified traders rather than counting rows. By the last full week, 141 of 395 traders (about 36%) were returning.

How to choose the right SQL practice site

  • You are new to SQL: start with SQLZoo or sql-practice.com, then WizardCamp's free SQL Foundations module if you already know you want crypto data.
  • You have a generic data analyst interview in a few weeks: finish LeetCode SQL 50 or work through DataLemur's question bank. Depth on one site beats sampling five.
  • You need SQL and Python: StrataScratch.
  • You are applying to crypto, DeFi or Web3 data roles: do the generic patterns first, then practice them on blockchain tables. Use Dune to explore full tables and build a public portfolio, and use onchain SQL practice with instant feedback to find out when a clean looking answer is wrong.

A 4 week SQL practice plan for crypto data roles

  1. Week 1, fundamentals: SELECT, filters, GROUP BY, joins and CASE WHEN on any free site.
  2. Week 2, interview patterns: top N per group, running totals, first and last per user and retention on LeetCode, DataLemur or StrataScratch.
  3. Week 3, the same patterns on chain data: the ten queries in our Dune SQL tutorial, from transaction counts to DENSE_RANK.
  4. Week 4, interview rehearsal: the real questions in crypto data analyst interview questions, then one public Dune dashboard you can talk through.

For the career side, How to Become a Crypto Data Analyst covers portfolios and where to apply, and the Web3 data analyst salary breakdown covers what the role pays. For a look inside the course itself, read Learn Onchain SQL: Inside WizardCamp.

Frequently Asked Questions

What is the best SQL practice site for data analyst interviews?

DataLemur and LeetCode SQL 50 are the strongest picks for generic data analyst interviews: both use interview style questions with an automatic grader. StrataScratch is better if the interview also covers Python. For crypto data analyst roles, add practice on blockchain tables with Dune or WizardCamp, because the hard part there is the data model.

Is LeetCode SQL 50 enough for a SQL interview?

It is enough to cover the core patterns for many analyst interviews: joins, aggregation, subqueries and window functions. It is not enough for domain specific roles. A crypto company will ask the same patterns on transactions, token transfers and trades, where decimals, failed transactions and token accounts change the right answer.

What are the best free SQL practice sites?

SQLZoo, HackerRank and sql-practice.com are free, and LeetCode, DataLemur and StrataScratch all have free questions. For blockchain data, Dune has a free tier with full mainnet tables, and WizardCamp has 9 free exercises: the SQL Foundations module plus the first three exercises of the Ethereum or Solana path.

Where can I practice SQL on real blockchain data?

On Dune, you can query full Ethereum, Solana and other chain tables for free, but nothing tells you if your answer is right. WizardCamp uses samples of the same Dune tables and gives instant feedback, across 163 hands-on exercises: 85 on Ethereum (25+ hours) and 78 on Solana (20+ hours).

Do crypto companies ask LeetCode style SQL questions?

They ask the same patterns, on their own data. On the Unchain Data job board, 60% of live data roles mention SQL and 29% mention onchain or blockchain data, while none name a practice platform. Expect questions like first transaction per wallet, holders of a token or new versus returning traders, not employees and departments.

Key Takeaways

  • Pick by interview, not by size. LeetCode for structure, DataLemur for analyst questions, StrataScratch for SQL plus Python.
  • Free is enough to learn the syntax. SQLZoo, HackerRank and sql-practice.com cover the fundamentals at no cost.
  • Generic sites stop at the data model. Token accounts, decimals and first seen logic only show up on real chain data.
  • Check for clean but wrong answers. 3,188 accounts, 3,187 owners and 76 holders are three answers to one question.
  • SQL is the skill employers name. 60% of 363 live data roles on the Unchain Data job board mention it, and none name a practice site.

Practice onchain SQL on WizardCamp for free →

Vincent Charles

Vincent Charles

  • Founder of Unchain Data
  • Former data lead at Morpho Labs and Binance
  • Builds Dune dashboards and data pipelines across Ethereum, Solana and Sui
  • Advises VC funds and DeFi protocols on data strategy
  • Featured on BBC for blockchain data research

Ready to practice what you just read?

WizardCamp has interactive SQL exercises on real blockchain data. Write queries, get instant feedback, earn certificates.

Explore WizardCamp