This repository contains a production-ready relational database schema for an e-commerce website, implemented for MySQL.
Files in this package:
ecommerce_db.sql— complete SQL: schema, demo data, triggers, stored procedure.ER_diagram.dot— Graphviz DOT source for the ER diagram.ER_diagram.pngandER_diagram.svg— rendered diagram (if available).README.md— this file.
- Open MySQL Workbench and connect to your local MySQL server.
- Open
ecommerce_db.sql(File → Open SQL Script). - Execute the whole script (click the lightning bolt or press Ctrl+Shift+Enter).
- Verify tables:
USE ecommerce_db; SHOW TABLES;
- Test queries provided in the earlier documentation.
CALL place_order_from_cart(2, 1, 'credit_card', @order_id);
SELECT @order_id;- Passwords in demo are placeholders. Use bcrypt on application side and store hashes.
- Test triggers and procedures on a development database first.