Sample Data
All SQL examples in this documentation use the following datasets. Bookmark this page for reference.
orders
The main transaction table tracking customer purchases.
| order_id | customer_id | amount | status | region | timestamp |
|---|---|---|---|---|---|
| ord_1 | c1 | 150.00 | completed | us-east | 2024-01-15 10:00:15 |
| ord_2 | c2 | 75.50 | completed | us-west | 2024-01-15 10:00:35 |
| ord_3 | c1 | 200.00 | pending | us-east | 2024-01-15 10:01:10 |
| ord_4 | c3 | 50.00 | cancelled | eu-west | 2024-01-15 10:01:45 |
| ord_5 | c2 | 300.00 | completed | us-west | 2024-01-15 10:02:20 |
| ord_6 | c4 | 125.00 | completed | us-east | 2024-01-15 10:02:55 |
| ord_7 | c1 | 89.99 | completed | us-east | 2024-01-15 10:03:30 |
| ord_8 | c5 | 450.00 | pending | eu-west | 2024-01-15 10:04:05 |
Schema:
CREATE TABLE orders (
order_id VARCHAR,
customer_id VARCHAR,
amount DECIMAL(10,2),
status VARCHAR,
region VARCHAR,
timestamp TIMESTAMP
)events
User activity and clickstream events.
| event_id | user_id | event_type | page | session_id | timestamp |
|---|---|---|---|---|---|
| e1 | u1 | page_view | /home | sess_1 | 2024-01-15 10:00:05 |
| e2 | u1 | click | /products | sess_1 | 2024-01-15 10:00:12 |
| e3 | u2 | page_view | /home | sess_2 | 2024-01-15 10:00:18 |
| e4 | u1 | add_to_cart | /products/1 | sess_1 | 2024-01-15 10:00:25 |
| e5 | u2 | click | /about | sess_2 | 2024-01-15 10:00:32 |
| e6 | u1 | purchase | /checkout | sess_1 | 2024-01-15 10:00:45 |
| e7 | u3 | page_view | /home | sess_3 | 2024-01-15 10:01:00 |
| e8 | u2 | page_view | /products | sess_2 | 2024-01-15 10:01:15 |
Schema:
CREATE TABLE events (
event_id VARCHAR,
user_id VARCHAR,
event_type VARCHAR,
page VARCHAR,
session_id VARCHAR,
timestamp TIMESTAMP
)logs
Application log messages for text processing examples.
| log_id | level | message | service | timestamp |
|---|---|---|---|---|
| l1 | INFO | User login successful user_id=u1 ip=192.168.1.1 | auth | 2024-01-15 10:00:05 |
| l2 | ERROR | Payment failed order_id=ord_3 error=insufficient_funds | payment | 2024-01-15 10:01:12 |
| l3 | WARN | High latency detected endpoint=/api/orders latency_ms=2500 | api | 2024-01-15 10:01:45 |
| l4 | INFO | Order created order_id=ord_5 customer_id=c2 | orders | 2024-01-15 10:02:20 |
| l5 | ERROR | Connection timeout service=inventory retry=3 | inventory | 2024-01-15 10:02:55 |
| l6 | INFO | Cache hit rate=0.85 keys=1250 | cache | 2024-01-15 10:03:30 |
Schema:
CREATE TABLE logs (
log_id VARCHAR,
level VARCHAR,
message VARCHAR,
service VARCHAR,
timestamp TIMESTAMP
)metrics
Numeric time-series data for math and statistical examples.
| metric_id | name | value | tags | timestamp |
|---|---|---|---|---|
| m1 | cpu_usage | 45.5 | host=server1 | 2024-01-15 10:00:00 |
| m2 | cpu_usage | 62.3 | host=server1 | 2024-01-15 10:01:00 |
| m3 | cpu_usage | 38.7 | host=server2 | 2024-01-15 10:00:00 |
| m4 | memory_mb | 2048 | host=server1 | 2024-01-15 10:00:00 |
| m5 | memory_mb | 2156 | host=server1 | 2024-01-15 10:01:00 |
| m6 | cpu_usage | 71.2 | host=server1 | 2024-01-15 10:02:00 |
| m7 | cpu_usage | 55.8 | host=server2 | 2024-01-15 10:01:00 |
| m8 | requests | 1250 | endpoint=/api | 2024-01-15 10:00:00 |
Schema:
CREATE TABLE metrics (
metric_id VARCHAR,
name VARCHAR,
value DOUBLE,
tags VARCHAR,
timestamp TIMESTAMP
)Use these datasets as you follow along with the SQL examples throughout the documentation.