Learn · sandbox

SQL and Python sandbox

Write and run code on real datasets without installing anything. SQL runs on DuckDB and Python runs with pandas, both inside your browser.

Ctrl + Enter to run
Data: Nordic Shop · customers, products, orders, order_items (what do the columns mean?)

customers · 300 rows · one row is one person or company that signed up

customer_id
Unique id for the customer
first_name
First name (not unique: many customers share a name)
city
Where they live. Empty (NULL) for one customer
country
Finland, Sweden or Estonia
signup_date
The day they created their account
segment
Consumer (a person) or Business (a company)

products · 29 rows · one row is one product the shop sells

product_id
Unique id for the product
product_name
Name shown in the shop
category
Electronics, Home, Sports, Books or Outdoor
price
Today's price in euros, including VAT

orders · 1,135 rows · one row is one order (one checkout)

order_id
Unique id for the order
customer_id
Who placed it. Links to customers.customer_id
order_date
The day the order was placed
status
delivered, shipped (on its way), cancelled or returned
channel
web (website) or app (mobile app)

order_items · 1,942 rows · one row is one product inside one order

order_id
Which order. Links to orders.order_id
product_id
Which product. Links to products.product_id
quantity
How many were bought (1 to 3)
unit_price
Price of one item when it was bought, in euros

orders.customer_id → customers.customer_id (who placed the order) · order_items.order_id → orders.order_id (which order the line belongs to) · order_items.product_id → products.product_id (which product was bought)