datasets real and made-up data to practise on
Datasets
Data for the Playground, Database Lab and Performance Lab. Pick one and open its files.
Real invoice lines from a UK online gift wholesaler, 2009–2011, cancellations and all.
1,875 invoice lines3 tablesDec 2009 – Dec 2011
what to watch for
Tricky rows
- Cancellation lines: Invoice starts with C and Quantity is negative11 rows
- Lines with no Customer ID (walk-in or unregistered buyers)819 rows
- Lines identical to an earlier line in every column30 rows
- Lines with Price 0 (adjustments, samples, damaged stock)11 rows
files
Open a file to see what one row means, its columns and a preview. Open in Playground starts a new file there with code that loads it.
invoice_lines1,875 rows · 8 columns · CSV
One line of an invoice, as the wholesaler’s system recorded it. Not unique: the same line can appear twice.
In your code: data/invoice_lines.csv
- Invoice
Invoice number; a leading C marks a cancellation
- StockCode
Product code; some codes are fees or adjustments, not products
- Description
Line description as typed on the invoice
- Quantity
Units; negative on cancellations
- InvoiceDate
Invoice date and time (UK local time)
- Price
Unit price in pounds sterling
- Customer ID
Customer number; empty for anonymous invoices
- Country
Customer country
products1,042 rows · 4 columns · CSV
One stock code, with the description and price it most often had.
In your code: data/products.csv
- stock_code
Stock code
- description
Most common description
- list_price
Most common unit price; empty when never sold at a price
- first_sold_at
First invoice with this code
customers56 rows · 3 columns · CSV
One registered customer who appears in these invoices.
In your code: data/customers.csv
- customer_id
Customer number
- country
Country
- first_order_at
First invoice
relationships
How to join these tables. Left column matches the right column.
- invoice_lines.StockCode → products.stock_code
- invoice_lines.Customer ID → customers.customer_id