Docsity

Database Project inventroy management, Study Guides, Projects, Research of Database Programming

Partial preview of the text

Download Database Project inventroy management and more Study Guides, Projects, Research Database Programming in PDF only on Docsity!

DATABASE

PROPOSAL

Inventory Management system

Prepared by:

Ruhma Aden

Ayesha

Shah bano

Saqib^ Azair DATA

MANAGEMENT

DATABASE

DA

Table of Contents

  • Abstract
  • OVERVIEW OF PROJECT........................................................................................................................................................
    • INTRODUCTION
    • Aim and Objectives
      • Aims:
      • Objectives:
  • ER-DIAGRAM OF PROJECT
  • SCHEMA OF ER DIAGRAM
  • Query 0f Inventory Management System
  • SQL INSERT DUMMY DATA QUERY:
  • Keys and constraints
  • ER DIAGRAM OF SQL - Explanation of the Inventory Management System Query (ER Diagram) - ER (Entity-Relationship) Diagram Explanation:
  • Q/A Related to Inventory management system

INTRODUCTION This inventory management system helps track products, brands, and stores while managing customer purchases. It allows adding new items, viewing data, and processing transactions efficiently. The system is built using a MySQL database and provides essential tools to streamline inventory and sales management.. Aim and Objectives Aims:

  • To create an efficient inventory management system that tracks products, stores, and customer transactions.
  • To streamline the process of adding, viewing, and managing inventory across multiple locations.
  • To improve business efficiency by automating product tracking and customer purchases. Objectives:
  • Develop a user-friendly system for managing brands, categories, products, and stores.
  • Enable easy addition and retrieval of inventory data.
  • Implement a secure customer cart and transaction system, including handling discounts and payments.
  • Ensure accurate stock management with real-time updates on inventory levels.
  • Provide reports on customer purchases and store performance.

ER-DIAGRAM OF PROJECT

SCHEMA OF ER DIAGRAM

-- Create provides table CREATE TABLE provides ( bid INT NOT NULL, sid INT NOT NULL, discount DECIMAL( 5 , 2 ), PRIMARY KEY (bid, sid), FOREIGN KEY (bid) REFERENCES brands(bid), FOREIGN KEY (sid) REFERENCES stores(sid) ); -- Create customer_cart table CREATE TABLE customer_cart ( cust_id INT PRIMARY KEY, name VARCHAR( 20 ) NOT NULL, mobno VARCHAR( 10 ) -- Changed to VARCHAR to accommodate non-numeric characters ); -- Create select_product table CREATE TABLE select_product ( cust_id INT NOT NULL, pid INT NOT NULL, quantity INT NOT NULL, PRIMARY KEY (cust_id, pid), FOREIGN KEY (cust_id) REFERENCES customer_cart(cust_id), FOREIGN KEY (pid) REFERENCES product(pid) ); -- Create [transaction] table CREATE TABLE [transaction] ( id INT PRIMARY KEY, total_amount DECIMAL( 10 , 2 ) NOT NULL, paid DECIMAL( 10 , 2 ) NOT NULL, due DECIMAL( 10 , 2 ) NOT NULL, gst DECIMAL( 5 , 2 ), discount DECIMAL( 10 , 2 ), payment_method VARCHAR( 10 ), cart_id INT NOT NULL, FOREIGN KEY (cart_id) REFERENCES customer_cart(cust_id) ); -- Create invoice table CREATE TABLE invoice ( item_no INT NOT NULL, product_name VARCHAR( 20 ) NOT NULL, quantity INT NOT NULL, net_price DECIMAL( 10 , 2 ) NOT NULL,

transaction_id INT NOT NULL, PRIMARY KEY (item_no, transaction_id), FOREIGN KEY (transaction_id) REFERENCES transaction );

SQL INSERT DUMMY DATA QUERY:

-------------------INSERTION ON TABLES-------------------------------

INSERT INTO brands (bid, bname) VALUES ( 1 , 'BrandA'), ( 2 , 'BrandB'), ( 3 , 'BrandC'), ( 4 , 'BrandD'), ( 5 , 'BrandE'); INSERT INTO inv_user (user_id, name, password, last_login, user_type) VALUES ('user1', 'Alice', 'password1', '2024- 09 - 01 10:00:00', 'admin'), ('user2', 'Bob', 'password2', '2024- 09 - 02 11:30:00', 'user'), ('user3', 'Charlie', 'password3', '2024- 09 - 03 12:45:00', 'user'), ('user4', 'David', 'password4', '2024- 09 - 04 13:00:00', 'user'), ('user5', 'Eve', 'password5', '2024- 09 - 05 14:15:00', 'admin'); INSERT INTO categories (cid, category_name) VALUES ( 1 , 'Electronics'), ( 2 , 'Clothing'), ( 3 , 'Books'), ( 4 , 'Furniture'), ( 5 , 'Toys'); INSERT INTO stores (sid, sname, address, mobno) VALUES ( 1 , 'Store1', '123 Main St', '1234567890'), ( 2 , 'Store2', '456 Elm St', '2345678901'), ( 3 , 'Store3', '789 Oak St', '3456789012'), ( 4 , 'Store4', '101 Pine St', '4567890123'), ( 5 , 'Store5', '202 Maple St', '5678901234'); INSERT INTO product (pid, cid, bid, sid, pname, p_stock, price, added_date) VALUES ( 1 , 1 , 1 , 1 , 'Laptop', 10 , 999.99, '2024- 09 - 01'), ( 2 , 2 , 2 , 2 , 'Jacket', 50 , 79.99, '2024- 09 - 02'), ( 3 , 3 , 3 , 3 , 'Novel', 100 , 19.99, '2024- 09 - 03'), ( 4 , 4 , 4 , 4 , 'Sofa', 5 , 499.99, '2024- 09 - 04'), ( 5 , 5 , 5 , 5 , 'Action Figure', 25 , 29.99, '2024- 09 - 05'); INSERT INTO provides (bid, sid, discount) VALUES ( 1 , 1 , 10.00), ( 2 , 2 , 15.00), ( 3 , 3 , 5.00), ( 4 , 4 , 20.00), ( 5 , 5 , 10.00); INSERT INTO customer_cart (cust_id, name, mobno) VALUES

Catagories table:

Stores table:

Product table

: Provides table: Customer_cart table: Select_product table:

ER DIAGRAM OF SQL

Explanation of the Inventory Management System Query (ER Diagram)

  • Brands Table (brands) o Purpose : Stores brand details. o Columns : bid (brand ID, primary key), bname (brand name). o ER Relation : One brand can have many products.
  • Users Table (inv_user) o Purpose : Stores information about users managing the system. o Columns : user_id (primary key), name, password, last_login, user_type (e.g., admin or regular user). o ER Relation : Users interact with the system but don't directly link to other tables.
  • Categories Table (categories) o Purpose : Holds different product categories. o Columns : cid (category ID, primary key), category_name. o ER Relation : One category can contain many products.
  • Stores Table (stores) o Purpose : Contains information about various stores. o Columns : sid (store ID, primary key), sname (store name), address, mobno (mobile number). o ER Relation : One store can stock many products.
  • Products Table (product) o Purpose : Stores product details, linking them to categories, brands, and stores. o Columns : pid (product ID, primary key), cid (category ID), bid (brand ID), sid (store ID), pname (product name), p_stock (stock count), price, added_date. o ER Relation : Products belong to one brand, one category, and can be stocked by one store.
  • Provides Table (provides) o Purpose : Links brands with stores and provides discount information.

brands 7 al product pt ER provides bat bat Paleck t dacot stores 1 al categories E cgury.т aldrs mabr inv user transaction TWITH pawrd lnt login aerJype inv_user customor cart 1 cint af TMETH 1 due g dacaat payтw^ тld 8 select product cint af invoice ENTING product nат qy rt prce qay 8

Q/A Related to Inventory management system

Q1:

Q2: