E-Commerce Database tables & Relationships
π― Objective:- The objective of this task is to design and create a relational database schema using SQL. You will learn to: Create databases and tables using DDL commands Apply Normalization to avoid redundancy Design an ER Diagram to represent entities and relationships Define Primary and Foreign Keys for referential integrity
π’ Domain: E-commerce System π Entities Identified Users β stores customer details Products β stores product details Orders β stores order information OrderItems β stores items in each order
π§© ER Diagram erDiagram USERS ||--o{ ORDERS : places ORDERS ||--o{ ORDER_ITEMS : contains PRODUCTS ||--o{ ORDER_ITEMS : purchased
π§° Tools Used MySQL Workbench VS Code (for writing SQL scripts) GitHub (for project submission)
π§ Key Concepts Covered πΉ DDL (Data Definition Language) Used to define the structure of the database. Commands used: CREATE DATABASE, CREATE TABLE, ALTER TABLE πΉ Normalization The schema is designed in 3rd Normal Form (3NF): No data redundancy Every non-key column depends only on the primary key Separate tables for entities with relationships through foreign keys πΉ ER Diagram Visual representation of entities and relationships β shows 1-to-many relationships between: Users β Orders Orders β OrderItems Products β OrderItems πΉ Primary & Foreign Keys Ensures unique identification and relationship integrity.
π§Ύ Outcomes β A well-structured, normalized relational schema
β ER Diagram representing entity relationships β SQL script with DDL and sample DML queries β Understanding of database design and normalization principles
πββοΈ How to Run Open MySQL Workbench (or any SQL tool). Create a new query tab and paste the SQL script from schema.sql. Click the Run (β‘) button to execute all queries. The database and tables will be created successfully. You can then run the sample INSERT and SELECT queries to test the data.
βοΈ Author Name: Parag Kotkar Role: MCA Student | Aspiring .NET & SQL Developer Task: Database Setup and Schema Design Date: October 2025