Website Analytics SQL Practice Dataset
Sessions, pageviews, events, users, and campaigns for funnel and attribution practice.
Download this dataset, free
No account, no email, no attribution required — free for any use, including commercially. Take the single .sql file to load everything into PostgreSQL, MySQL, SQLite, DuckDB, or SQL Server, or grab the raw CSVs.
Website Analytics models a small SaaS marketing site. It includes sessions, pageviews, funnel events, known users, and campaign metadata, so it is built for SQL questions about traffic quality, conversion, content performance, and attribution.
The data intentionally mixes anonymous and known sessions, direct and campaign traffic, repeated pageviews, and events that only appear for some sessions. That makes it a good fit for practicing COUNT DISTINCT, rates, left joins, and null-aware filters.
Schema
Schema · Website AnalyticsView dataset schema5 tables
One row per known (signed-up) user.
Marketing campaigns with their channel and UTM tags.
One row per visit. Anonymous visits have a null user_id; organic and direct visits have a null campaign_id.
One row per page viewed within a session, in view_order.
Funnel events (signup, add_to_cart, checkout, purchase). Only purchase events carry a value.
Best for
- COUNT DISTINCT, conversion rates, and funnel reports.
- LEFT JOIN attribution from sessions to campaigns.
- NULL handling for anonymous users and uncampaigned traffic.
Starter questions
- Which channels drive the highest purchase rate?
- Which pages are viewed most often?
- How many sessions are anonymous?