How africandillinger/ecommerce-db-schema-design works
This repository is a PostgreSQL learning project: it documents normalizing a flat e-commerce dataset into related tables, then practicing queries against that data. The visible files support a migration script and four table definitions; README-described five-level query practice is represented at the existing sql directory because its query files are absent from the supplied tree. The schema and data-flow links follow the README and filenames; SQL contents were not available to verify implementation details.
Main entry points: migrate_data.sql Data migration · orders.sql Orders · order_items.sql Order items · customers.sql Customers
Components 9
Relational model
- Customers
sql/schema/customers.sql - Orders
orders.sql - Order items
order_items.sql - Products
products.sql
Data workflow
- Flat dataset
- Data migration
migrate_data.sql - PostgreSQL
SQL practice
- Query practice
sql
Other components
- Analyst
Connections 10
- Flat dataset → Data migration: transforms
- Data migration → Customers: writes
- Data migration → Orders: writes
- Data migration → Order items: writes
- Data migration → Products: writes
- Customers → Orders: customer FK
- Orders → Order items: order FK
- Products → Order items: product FK
- Analyst → Query practice: runs queries
- Query practice → PostgreSQL: queries