A relational database project built in MySQL to manage products, categories, and suppliers.
This database simulates a basic inventory system where:
- Each product belongs to a category
- Each product is supplied by a supplier
- Stock levels and pricing are tracked
- Analytical queries provide business insights
The project consists of three main tables:
categories
- Stores product categories (e.g., Electronics, Gaming)
suppliers
- Stores supplier information (name, phone, country)
products
- Stores product data:
- Name
- Price
- Stock
- Category (foreign key)
- Supplier (foreign key)
- products.id_category → categories.id_category
- products.id_supplier → suppliers.id_supplier
- Open MySQL Workbench (or any MySQL client)
- Run the schema file: schema.sql;
- Insert data: data.sql;
- Run analysis queries: queries.sql;
The project includes a set of queries to analyze inventory data.
- View products with category and supplier
- Search products by category
- Search products by supplier
- View products with category and supplier
- Search products by category
- Search products by supplier
- Total number of products
- Products per category
- Minimum, maximum, and average price
- Product with highest / lowest stock
- Average price by category
- Supplier with most products
- Total inventory value by category (price × stock)
- Products with low stock
- Average price by supplier
- Add constraints (NOT NULL, CHECK)
- Implement triggers for stock updates
- Create views for common queries
- Add stored procedures for business logic
- Expand dataset with more realistic data
Pull requests are welcome.
For major changes, please open an issue first to discuss what you would like to improve.
This project is open source and available under the MIT License.