This project is a comprehensive SQL-based Inventory Management System designed to manage suppliers, products, stock, customers, orders, and purchase records. It includes several database tables, constraints, stored procedures, triggers, and a billing view for enhanced database functionality.
- Database: INVENTORY
- Tables: Supplier, Product, Stock, Customer, Orders, Purchase
- Procedures: Add new suppliers, products, customers, and orders; automatic ID generation
- Views: Billing view to calculate and display order total
- Triggers: For automatic stock updates on order placement and product deletion
Ensure you have:
SQL Server or a compatible SQL database engine installed A basic understanding of SQL for executing scripts and creating databases
- Clone the repository:git clone (https://github.com/chandanaamarendra/INVENTORY-MANAGEMENT-PROJECT)
- Open the SQL script file and run it in your SQL editor.
- Verify that all tables, constraints, views, procedures, and triggers have been created.
- Creating Tables: Run the CREATE TABLE commands to set up the required tables for managing inventory.
- Inserting Data: Use the provided INSERT INTO statements to populate the tables with sample data.
- Stored Procedures: Execute procedures like NEW_SUPPLIER, NEW_PRODUCT, and AUTO_ID_SUP to add records with or without manually specified IDs.
- Triggers: Place orders or delete products to trigger stock updates or cascaded deletions.
- Supplier Management: Tracks supplier details with unique identifiers and constraints.
- Product Inventory: Manages product details, including categories, prices, and supplier relationships.
- Stock Tracking: Keeps stock quantity, reorder level, and minimum order quantity data up to date.
- Order Processing: Manages customer orders, calculates total amounts, and reduces stock automatically.
- Data Integrity: Enforces data integrity with primary and foreign key constraints, check constraints, and unique constraints.
- Automation: Automatically generates sequential IDs for new entries and updates stock based on orders.
- Supplier: Contains details about suppliers including name, address, and contact information.
- Product: Details of available products, with price, category, and associated supplier ID.
- Stock: Tracks product quantities, reorder levels, and minimum order quantities.
- Customer: Holds customer details, including name, address, and contact details.
- Orders: Stores order details such as product, customer, order date, and quantity.
- Purchase: Records purchase history, linking products and suppliers.
Generates a bill view that displays customer order information along with the total amount.
- TRI_on_ORDERS: Automatically decreases stock quantity upon order placement.
- TRI_ON_PRO: Deletes stock details when a product is removed.
- TRI_UPDATE_ORDER: Adjusts stock based on order quantity updates.
-
Add a new supplier
EXEC NEW_SUPPLIER 'S0011', 'Kishan', 'Balaji Nagar', 'Eluru', '8965896455', 'kishan@gmail.com';
-
Create a new order
EXEC AUTO_ID_ORDER 'P0004', 'C0006', 50;
-
View all stock details
SELECT * FROM STOCK;
-
See the total bill
SELECT * FROM view_Bill
This project is licensed under the MIT License.