Ask a shop database a question in English
This is a live demo on a fictional Swiss shop. Every answer below is computed from the data by SQL you can read.
Ask anything you like. It does not have to be one of the examples, and the query is written fresh for whatever you type. The demo shop has orders from August 2025 to July 2026.
Or try one
Answer
Which products on the .eu storefront still show German names?
| sku | name | category |
|---|---|---|
| ALP-0122 | Plaid Rigi | Blankets |
| ALP-0162 | Bademantel Klassik | Bath |
| ALP-0188 | Badematte Sils | Bath |
| ALP-0206 | Gartenstuhl Titlis | Outdoor |
| ALP-0212 | Schneidebrett Rigi | Kitchen |
| ALP-0221 | Kaffeetasse Sils | Kitchen |
| ALP-0238 | Badematte Rigi | Bath |
| ALP-0239 | Aufbewahrungskorb Klassik | Storage |
| ALP-0254 | Stehleuchte Sils | Lighting |
| ALP-0261 | Wandbild Rigi | Decor |
The SQL that produced it
SELECT DISTINCT
p.sku,
p.name,
p.category
FROM product AS p
JOIN storefront AS s
ON s.id = p.storefront_id
WHERE s.domain = 'alpsteingoods.eu'
AND p.name_language = 'de'
LIMIT 200Written from your question by a language model, then run against the demo database. The translation is cached, so asking the same question twice does not write it twice. The query itself runs every time, which is why the database timing above is never zero.
Schema
CREATE TABLE storefront (
id INTEGER PRIMARY KEY,
domain TEXT NOT NULL,
currency TEXT NOT NULL,
locale TEXT NOT NULL
);
CREATE TABLE product (
id INTEGER PRIMARY KEY,
sku TEXT NOT NULL, -- the same sku can be listed on both storefronts
name TEXT NOT NULL,
name_language TEXT NOT NULL, -- language the name is written in: 'de' or 'en'
category TEXT NOT NULL,
cost_chf REAL NOT NULL, -- what the shop pays, always in CHF
storefront_id INTEGER NOT NULL REFERENCES storefront(id)
);
CREATE TABLE product_price (
id INTEGER PRIMARY KEY,
product_id INTEGER NOT NULL REFERENCES product(id),
currency TEXT NOT NULL,
price REAL NOT NULL
);
CREATE TABLE inventory_snapshot (
id INTEGER PRIMARY KEY,
product_id INTEGER NOT NULL REFERENCES product(id),
snapshot_date TEXT NOT NULL, -- one row per product per week, not per day
units_on_hand INTEGER NOT NULL
);
CREATE TABLE customer (
id INTEGER PRIMARY KEY,
first_name TEXT NOT NULL,
country TEXT NOT NULL,
language TEXT NOT NULL,
created_at TEXT NOT NULL
);
CREATE TABLE customer_order (
id INTEGER PRIMARY KEY,
customer_id INTEGER NOT NULL REFERENCES customer(id),
storefront_id INTEGER NOT NULL REFERENCES storefront(id),
placed_at TEXT NOT NULL, -- 'YYYY-MM-DD HH:MM:SS'
paid_at TEXT, -- null when the order was cancelled
shipped_at TEXT, -- null when the order has not shipped
currency TEXT NOT NULL, -- every amount on this order is in this currency
status TEXT NOT NULL -- 'shipped', 'paid', 'cancelled' or 'refunded'
);
CREATE TABLE order_line (
id INTEGER PRIMARY KEY,
order_id INTEGER NOT NULL REFERENCES customer_order(id),
product_id INTEGER NOT NULL REFERENCES product(id),
quantity INTEGER NOT NULL,
unit_price REAL NOT NULL, -- per unit, in the order's currency
discount_amount REAL NOT NULL -- money off this line, in the order's currency.
-- An amount, not a percentage. Line total is
-- quantity * unit_price - discount_amount.
);
CREATE TABLE refund (
id INTEGER PRIMARY KEY,
order_id INTEGER NOT NULL REFERENCES customer_order(id),
product_id INTEGER NOT NULL REFERENCES product(id),
amount REAL NOT NULL, -- in the order's currency
currency TEXT NOT NULL,
reason TEXT NOT NULL,
refunded_at TEXT NOT NULL
);
CREATE TABLE fx_rate (
id INTEGER PRIMARY KEY,
rate_date TEXT NOT NULL,
currency TEXT NOT NULL,
rate_to_chf REAL NOT NULL -- multiply an amount in this currency by this to get CHF
);What this is
The shop is invented, and so is its data. The database is real, and so is the query. Every number on this page was computed by the SQL shown beside it, against 2025-08-01 to 2026-07-31 of orders, products, stock and exchange rates.
The data has a few problems in it on purpose, because real shops do. Untranslated product names on the wrong storefront, revenue split across four currencies that does not add up until it is converted, orders that shipped late, and products that kept selling after the shelf was empty. Those are the sorts of things worth finding in a real catalogue, and this is what finding them looks like.