SQL practice databases and sample data files
Download free relational datasets for SQL practice. Small databases come
as one .sql file containing
the tables and rows, plus a CSV for each table. Larger databases separate
the schema from the data: a schema SQL script creates the tables and loads
the complete Parquet files.
Every guide documents its tables, keys, row counts, download formats, and browser sample. All SQLShed datasets are invented for practice and published under CC0 1.0, so commercial use and redistribution are allowed without attribution.
Complete SQL files: tables and INSERT statements
These 4 compact databases put the schema and data in one file. They load into DuckDB, PostgreSQL, MySQL, or SQLite as-is; SQL Server needs at most the small edit documented in the file header. Use the CSV copies when you want to practice an import.
-
Orders, products, inventory, suppliers, and customers for store-operations SQL practice.
Tables: customers · products · categories · orders · order_items · suppliers
Joins · Aggregates · GROUP BY · NULL handling · Dates · CTEs · Top-N reports · INSERT / UPDATE / DELETE
6 tables, 130 rows, Small size, beginner level, CSV and SQL -
Movies, customers, and rental history for compact join, aggregate, and NULL practice.
Tables: movies · customers · rentals
Joins · Aggregates · GROUP BY · NULL handling · Top-N reports
3 tables, 48 rows, Small size, beginner level, CSV and SQL -
Sessions, pageviews, events, users, and campaigns for funnel and attribution practice.
Tables: users · campaigns · sessions · pageviews · events
Joins · Aggregates · GROUP BY · NULL handling · Dates · Window functions · CTEs · Funnels and rates · Attribution
5 tables, 161 rows, Small size, intermediate level, CSV and SQL -
Departments, employees, projects, and assignments, with a reporting line for self-join practice.
Tables: departments · employees · projects · assignments
Joins · Self-joins · Many-to-many · Aggregates · GROUP BY · NULL handling · Subqueries
4 tables, 57 rows, Small size, intermediate level, CSV and SQL
Schema SQL plus full Parquet data
These 5 larger databases avoid enormous INSERT
scripts. Their .schema.sql
file contains CREATE TABLE and COPY statements that load the adjacent
Parquet files into DuckDB. The downloadable data is complete; the
in-browser playground uses a smaller sample with the same schema so it
stays responsive.
-
Customers, products, orders, line items, payments, and returns at realistic online-retail volume.
Tables: categories · customers · products · orders · order_items · payments · returns
Joins · Many-to-many · Aggregates · GROUP BY · NULL handling · Dates · CTEs · Top-N reports
7 tables, 426,024 rows, Large size, intermediate level, PARQUET and SCHEMA -
Accounts, merchants, and two years of posted transactions with no stored balance to read off.
Tables: branches · merchants · customers · accounts · transactions
Joins · Aggregates · GROUP BY · NULL handling · Dates · Window functions · Subqueries · CTEs · Top-N reports
5 tables, 343,840 rows, Large size, advanced level, PARQUET and SCHEMA -
Organizations, plan intervals, invoices, and product usage for a B2B SaaS business.
Tables: plans · organizations · users · subscriptions · invoices · usage_events
Joins · Aggregates · GROUP BY · NULL handling · Dates · Window functions · Subqueries · CTEs · Funnels and rates
6 tables, 259,208 rows, Large size, advanced level, PARQUET and SCHEMA -
Channels, campaigns, ad groups, and two years of daily performance where every metric is a ratio.
Tables: channels · campaigns · ad_groups · daily_performance · conversions
Joins · Aggregates · GROUP BY · NULL handling · Dates · Window functions · CTEs · Top-N reports · Attribution
5 tables, 303,609 rows, Large size, intermediate level, PARQUET and SCHEMA -
Student, enrollment, and grade records merged from three schools, with the mixed formats, padding, and duplicates left to clean.
Tables: schools · courses · students · contacts · enrollments · grades
Joins · GROUP BY · NULL handling · Dates · Text cleanup · Window functions · CTEs
6 tables, 64,384 rows, Medium size, intermediate level, CSV and PARQUET and SCHEMA
Which format should I use?
Choose the full SQL dump for a small database you want to load in one step. Choose CSV to practice imports or inspect rows directly. Choose Parquet for larger analytical data where column types and file size matter.
Need a question to solve?
Start with the datasets with questions and answers. Each prompt opens with the right browser sample and links back to a tested solution.