{"id":25747988,"url":"https://github.com/vivekuw/e-commerce-database-management-project","last_synced_at":"2025-02-26T12:18:38.543Z","repository":{"id":213538140,"uuid":"734356154","full_name":"vivekuw/E-Commerce-Database-Management-Project","owner":"vivekuw","description":"This is DBMS project of E commerce database . This project content ER diagram or Relation schema diagram and SQL queries. ","archived":false,"fork":false,"pushed_at":"2023-12-27T14:44:19.000Z","size":1622,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-12-28T12:29:18.363Z","etag":null,"topics":["dbms","dbms-project","dbmsminiproject","ecommerce","mysql","mysql-database","sql"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vivekuw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-12-21T13:32:15.000Z","updated_at":"2023-12-28T06:26:44.000Z","dependencies_parsed_at":"2023-12-27T12:28:25.305Z","dependency_job_id":"cbef7dad-b7d0-4a8e-8bf5-41c5b4e12790","html_url":"https://github.com/vivekuw/E-Commerce-Database-Management-Project","commit_stats":null,"previous_names":["vivekuw/e-commerce-database-management-project"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekuw%2FE-Commerce-Database-Management-Project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekuw%2FE-Commerce-Database-Management-Project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekuw%2FE-Commerce-Database-Management-Project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vivekuw%2FE-Commerce-Database-Management-Project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vivekuw","download_url":"https://codeload.github.com/vivekuw/E-Commerce-Database-Management-Project/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240849007,"owners_count":19867617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dbms","dbms-project","dbmsminiproject","ecommerce","mysql","mysql-database","sql"],"created_at":"2025-02-26T12:18:37.686Z","updated_at":"2025-02-26T12:18:38.441Z","avatar_url":"https://github.com/vivekuw.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# E-Commerce-Database-management-project\n\n  As a part of our course, I made this project for Database Management Systems (DBMS). This project contains theoretical as well as implementation in SQL.\n  \n### Contents\n  •\tProject Description\n  \n  •\tBasic structure\n  \n    o\tFunctional requirements\n    \n    o\tEntity Relation (ER) diagram and constraints\n    \n    o\tRelational database schema\n    \n  •\tImplementation\n  \n    o\tCreating tables\n    \n    o\tInserting data\n    \n# Pre-requisite\n  •\tMySQL\n  \n### Project Description\n  The E-Commerce Database Management Project (DBMD) is a comprehensive solution designed to streamline and optimize the operations of an e-commerce business. This project focuses on creating a robust database management system that facilitates efficient handling of various aspects of an online store, from product inventory to customer orders.\n\n### Relational Database Schema - e-commerce -ER diagram\n\n![alt text](https://github.com/vivekuw/E-Commerce-Database-management-project/blob/23a0b08070f5fe22a055910cafc06d86dc3befb6/E%20commerce%20ER%20Diagram.jpg)\n\n### ER diagram \n\n![alt text](https://github.com/vivekuw/E-Commerce-Database-management-project/blob/a83d9c48c82ffd18dee02c13f42e87b7069faf67/ECommerce.jpg)\n\n### Create Schema(database) in MySQL\n```sql\n  create schema e_commerce;\n```\n### Create Tables\n\n  Customer Table\n \n ```sql\n    create table e_commerce.customer (\n      customer_id int primary key,\n      FirstName varchar(50),\n      MiddleName varchar(50),\n      LastName varchar(50),\n      Email varchar(100),\n      DateOfBirth date,\n      phone INT(10),\n      age int null\n    );\n\n ```\n  Category Table\n  \n  ```sql\n    create table e_commerce.category (\n      category_id int primary key,\n      category_name varchar(255),\n      Description varchar(255)\n  );\n```\n  Seller Table\n  \n  ```sql\n    create table e_commerce.seller (\n      seller_id int primary key,\n      seller_name varchar(255),\n      seller_phone int(15),\n      total_sales float\n  );\n```\n  Address Table\n  \n  ```sql\n    create table e_commerce.address(\n      address_id int primary key,\n      apart_no int(10),\n      apart_name varchar(255),\n      streetname varchar(255),\n      state varchar(255),\n      city varchar(255),\n      pincode int(6),\n      customer_id int ,\n      FOREIGN KEY (customer_id) REFERENCES customer(customer_id) on delete cascade on update no action\n  );\n```\n  Product Table\n  \n  ```sql\n    create table e_commerce.product (\n      product_id int primary key,\n      product_name varchar(50),\n      MRP float,\n      stock bool,\n      brand varchar(255),\n      category_id int,\n      seller_id int,\n      FOREIGN KEY (category_id) REFERENCES category(category_id) on delete set null on update no action,\n      FOREIGN KEY (seller_id) REFERENCES seller(seller_id) on delete set null on update no action\n  );\n```\n  Cart Table\n  \n```sql\n    create table e_commerce.cart (\n      cart_id int primary key,\n      grandtoatl float ,\n      itemtotal int,\n      customer_id int,\n      FOREIGN KEY (customer_id) REFERENCES customer(customer_id) on delete set null on update no action,\n      product_id int,\n      FOREIGN KEY (product_id) REFERENCES product(product_id) on delete set null on update no action\n  );\n```\n  Review Table\n  \n  ```sql\n    create table e_commerce.review(\n      review_id int primary key,\n      description varchar(255),\n      rating enum('1','2','3','4','5'),\n      customer_id int,\n      FOREIGN KEY (customer_id) REFERENCES customer(customer_id) on delete set null on update no action,\n      product_id int,\n      FOREIGN KEY (product_id) REFERENCES product(product_id) on delete set null on update no action\n);\n```\n  Order Table\n  \n```sql\n    create table e_commerce.order_table(\n      order_id int primary key,\n      order_date datetime,\n      order_amount float,\n      order_status enum('delivery','not delivery'),\n      shipping_date datetime,\n      customer_id int,\n      FOREIGN KEY (customer_id) REFERENCES customer(customer_id) on delete set null on update no action,\n      cart_id int,\n      FOREIGN KEY (cart_id) REFERENCES cart(cart_id) on delete set null on update no action\n  );\n```\n\n  OrderItem Table\n\n```sql\n    create table e_commerce.orderitem(\n      order_id int,\n      product_id int,\n      foreign key (order_id) references order_table(order_id) on delete set null on update no action,\n      foreign key (product_id) references product(product_id) on delete set null on update no action,\n      MRP float,\n      quantity int\n  );\n```\n\n  Payment Table\n\n  ```sql\n    create table e_commerce.payment(\n      paymentMode enum('online','offline'),\n      dateofpayment datetime,\n      order_id int,\n      foreign key (order_id) references order_table(order_id) on delete set null on update no action,\n      customer_id int,\n      FOREIGN KEY (customer_id) REFERENCES customer(customer_id) on delete set null on update no action\n  );\t\n```\n\n### Insert the data\n\n  Customer Table\n  ```sql\n      insert into e_commerce.customer values (1,'vivek','umesh','wadher','wadhervivek6904@gmail.com','2004-09-06',2147483647,0);\n      insert into e_commerce.customer values (2,'devansh','hitesh','makawana','devansh@gmail.com','2004-05-23',2147483647,0);\n      insert into e_commerce.customer values (3,'jay','amit','chauhan','jay@gmail.com','2004-05-02',2147483647,0);\n```\n\n  Category Table\n  \n  ```sql\n    insert into e_commerce.category values (1,'Mobiles \u0026 Computer','all the brands are there like phone, tablets, PC, Desktop '); \n    insert into e_commerce.category values (2,'TV \u0026 Aplliances \u0026 Electronics','all the brands are there like tv smart, tv oled, mixer and many more'); \n    insert into e_commerce.category values (3,'Men`s Fashion','all the brands are there like t-Shirts, jeans, shirts,etc'); \n    insert into e_commerce.category values (4,'Women`s Fashion','all the brands are there like shorts,one pic, kurti, t-shirt,jeans,etc');\n```\n\n  Seller Table\n  \n  ```sql\n  insert into e_commerce.seller values (1,'prem upadhay','1295874636',12000.75);  \n  insert into e_commerce.seller values (2,'jay chauhan','7865423565',38000.20);  \n  insert into e_commerce.seller values (3, 'yash shetty','7465456456',8529.23);\n```\n\n  Address Table\n\n  ```sql\ninsert into e_commerce.address values (1,'108','khodiayr chs ltd','devipada borivali east','maharsahtra','mumbai','400066',1);\ninsert into e_commerce.address values (2,'214/B','vitthal chs','rattan nagar kandivali east','maharsahtra','mumbai','400801',2);\ninsert into e_commerce.address values (3,'52','oberoi sky city','thakur complex malad east','maharsahtra','mumbai','400526',3);\n```\n\n  Product Table\n  \n```sql\ninsert into e_commerce.product values(1,'pen drive',250,52,'hp',2,1);\ninsert into e_commerce.product values(2,'monitor',25000,30,'dell',1,3);\ninsert into e_commerce.product values(3,'keyborad',765,69,'lenovo',2,2);\ninsert into e_commerce.product values(4,'i phone 15',75000,10,'Apple',1,2);\ninsert into e_commerce.product values(5,'Mens t-shirts',350,22,'H\u0026M',3,1);\ninsert into e_commerce.product values(6,'mens kurta',766,32,'ZARA',3,3);\ninsert into e_commerce.product values(7,'women shorts',360,52,'pantaloom',4,2);\ninsert into e_commerce.product values(8,'women jeans',699,65,'zudio',4,1);\ninsert into e_commerce.product values(9,'mouse',299,65,'lenovo',2,3);\ninsert into e_commerce.product values(10,'destop',25000,10,'dell',1,2);\n```\n\n  Cart Table\n\n```sql\ninsert into e_commerce.cart values (1,75000,1,1,4); \ninsert into e_commerce.cart values (2,1050,3,2,5); \ninsert into e_commerce.cart values (3,598,2,3,9); \ninsert into e_commerce.cart values (4,2160,6,2,7); \ninsert into e_commerce.cart values (5,250,1,1,1); \ninsert into e_commerce.cart values (6,3830,6,3,6); \n```\n\n  Order Table\n\n```sql\ninsert into e_commerce.order_table values (1,'2023-12-06 10:12:20',75000,'delivery','2023-12-09 09:25:02',1,1); \ninsert into e_commerce.order_table values (2,'2023-12-07 20:23:20',1050,'delivery','2023-12-12 05:29:02',2,2); \ninsert into e_commerce.order_table values (3,'2023-12-08 18:12:20',598,'delivery','2023-12-23 09:26:02',3,3); \ninsert into e_commerce.order_table values (4,'2023-12-10 15:45:20',2160,'delivery','2023-12-15 11:26:02',2,4); \ninsert into e_commerce.order_table values (5,'2023-12-10 15:45:20',250,'delivery','2023-12-15 11:26:02',1,5); \ninsert into e_commerce.order_table values (6,'2023-12-21 16:23:20',3830,'delivery','2023-12-29 11:35:09',3,6); ****\n```\n\n  Order Item Table\n\n```sql\ninsert into e_commerce.orderitem values (7500,1,1,4);\ninsert into e_commerce.orderitem values (1050,3,2,5);\ninsert into e_commerce.orderitem values (299,2,3,9);\ninsert into e_commerce.orderitem values (360,6,4,7);\ninsert into e_commerce.orderitem values (250,1,5,1);\ninsert into e_commerce.orderitem values (766,6,6,6);\n```\n\n  Payment Table\n\n```sql\ninsert into e_commerce.payment values ('online','2023-12-06 10:12:56',1,1,1);\ninsert into e_commerce.payment values ('online','2023-12-07 20:23:20',2,2,2);\ninsert into e_commerce.payment values ('online','2023-12-08 18:12:20',3,3,3);\ninsert into e_commerce.payment values ('online','2023-12-10 15:45:20',4,2,4);\ninsert into e_commerce.payment values ('online','2023-12-10 15:45:20',5,1,5);\ninsert into e_commerce.payment values ('online','2023-12-21 16:23:20',6,3,6);\n```\n\nReview Table\n\n```sql\ninsert into e_commerce.review values (1,'i phone 15 is amazing.','5',1,4);\ninsert into e_commerce.review values (2,'wow t-shirts ,good in quality.','3',2,5);\ninsert into e_commerce.review values (3,'best mouse in the world.','4',3,9);\ninsert into e_commerce.review values (4,'very comfatabale in size and quality.','4',2,7);\ninsert into e_commerce.review values (5,'the size is 128mb pendrive, speed is good.','5',1,1);\ninsert into e_commerce.review values (6,'size of kurta and quality is good','2',3,6);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekuw%2Fe-commerce-database-management-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvivekuw%2Fe-commerce-database-management-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvivekuw%2Fe-commerce-database-management-project/lists"}