advancedTop 15 Database Design Questions

Design a database schema for an e-commerce platform (customers, products, orders, categories, reviews).

customers(id, email UNIQUE, name, created_at) — email is natural unique key categories(id, name, parent_id NULLABLE FK self-referential for hierarchy) products(id, name, price DECIMAL, sku UNIQUE, category_id FK, created_at) orders(id, customer_id FK, status, total_amount, created_at) — snapshot total at order time order_items(order_id FK, product_id FK, quantity, unit_price, PRIMARY KEY(order_id,

This is a Pro chapter

Sign in, then upgrade to Pro or Power to unlock this and the full Databases Mastery library.

Design a database schema for an e-commerce platform (customers, products, orders, categories, reviews).

Next Step

Continue to Design a scalable multi-tenant SaaS database for 50,000 tenants.← Back to all SQL questions