The script creates and fills four tables. It is the same data as the "Office supplies shop" in the SQL sandbox, so learners can work in the browser and you can load the file into your own database.
Table | Rows | Linked by |
|---|---|---|
customers | 8 | id |
products | 6 | id |
orders | 10 | customer_id → customers.id |
order_items | 15 | order_id → orders.id, product_id → products.id |
One customer, Hannah Wolf, has never ordered: useful for showing what a LEFT JOIN keeps.
CREATE TABLE customers (id INTEGER PRIMARY KEY, name TEXT NOT NULL, company TEXT, city TEXT, country TEXT);
CREATE TABLE products (id INTEGER PRIMARY KEY, name TEXT NOT NULL, category TEXT, price REAL);
CREATE TABLE orders (id INTEGER PRIMARY KEY, customer_id INTEGER REFERENCES customers(id), order_date TEXT, status TEXT);The data is public domain under CC0 1.0.
