Website Analytics SQL Practice Dataset
Sessions, pageviews, events, users, and campaigns for funnel and attribution practice.
- Tables
- 5
- Rows
- 161
- Size
- Small
- Level
- Intermediate
- Domain
- Marketing
- Formats
- CSV · SQL
Download this dataset, free
No account, no email, no attribution required:
dedicated to the public domain under CC0 1.0, so commercial use and
redistribution are fine.
Open it in the browser playground, take the single website_analytics.sql file to load every table into PostgreSQL, MySQL, SQLite, DuckDB, or SQL Server, or grab the raw CSV files below.
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
Join conditions
- sessions.user_id = users.user_id
- sessions.campaign_id = campaigns.campaign_id
- pageviews.session_id = sessions.session_id
- events.session_id = sessions.session_id
Schema · Website Analytics View dataset schema 5 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?
Practice lessons
More practice datasets
Orders, products, inventory, suppliers, and customers for store-operations SQL practice.
Departments, employees, projects, and assignments, with a reporting line for self-join practice.
Customers, products, orders, line items, payments, and returns at realistic online-retail volume.
Channels, campaigns, ad groups, and two years of daily performance where every metric is a ratio.
Organizations, plan intervals, invoices, and product usage for a B2B SaaS business.