SQL - Sample Datasets

Overview

This page showcases the live sample datasets used across examples. Use it to understand table shapes and values at a glance.

Employees & Departments

departments

idname
1Engineering
2HR
3Sales

employees

idfirst_namedepartment_idsalaryhired_atgendercitytitle
1Ada11200002021-01-10 10:00:00FemaleSan FranciscoEngineer
2Bob1900002021-05-05 09:30:00MaleNew YorkEngineer
3Chen280000MaleSeattleHR Specialist
4Dee31100002022-03-01 12:00:00FemaleAustinSales Manager
5Eli11300002020-11-20 15:15:00MaleBostonPrincipal Engineer

Customers, Orders & Products

customers

idnamegendercity
1AliceFemaleSan Francisco
2BenMaleNew York
3CaraFemaleSeattle
4DanMaleAustin
5EvaFemaleBoston

products

idnamecategoryprice
1Laptop ProElectronics1999
2Wireless MouseElectronics49.99
3Office ChairFurniture299
4Standing DeskFurniture499
5Coffee BeansGrocery14.99

orders

idcustomer_idorder_datetotal
112024-05-012048.99
222024-05-03313.98
332024-05-05513.99

order_items

idorder_idproduct_idqtyprice
11111999
212149.99
3231299
425114.99
5341499
632114.99

Useful Views

Top customers by total

nametotal_spend
Alice2048.99
Cara513.99
Ben313.99

Top products by revenue

namerevenue
Laptop Pro1999
Standing Desk499
Office Chair299
Wireless Mouse64.98
Coffee Beans14.99

Reset all sample data