Online shop
customers, products, orders and what is in each order. 8 tables, 37 columns, no data.
The map
Each line runs from a linking column (N) to the key it points at (1). The same tables are listed below as text.
The tables
customers
idbigintPKemailvarchar(255) requiredfull_namevarchar(200) requiredcreated_attimestamptz required
addresses
idbigintPKcustomer_idbigint→ customers requiredstreetvarchar(200) requiredcityvarchar(100) requiredcountryvarchar(100) required
categories
idbigintPKnamevarchar(200) requiredparent_idbigint→ categories
products
idbigintPKnamevarchar(200) requiredpricenumeric(12,2) requiredcategory_idbigint→ categories requiredin_stockboolean required
orders
idbigintPKcustomer_idbigint→ customers requiredshipping_address_idbigint→ addressesplaced_attimestamptz requiredstatusvarchar(30) required
order_items
idbigintPKorder_idbigint→ orders requiredproduct_idbigint→ products requiredquantityinteger requiredunit_pricenumeric(12,2) required
payments
idbigintPKorder_idbigint→ orders requiredamountnumeric(12,2) requiredmethodvarchar(30) requiredpaid_attimestamptz required
product_reviews
idbigintPKproduct_idbigint requiredcustomer_idbigint requiredratingsmallint requiredbodytext
What you could look at in SSDO
- Ask which tables orders depends on.
- Open the Map and follow order_items to both of its parents.
- product_reviews has a customer_id and product_id nobody declared as links: Review describes them.
Create a free workspace and open this sample All samples
PK is a primary key. “→ table” is a link (a foreign key) to that table. This page is a description of a structure we wrote; it holds no rows.