Skip to content

kendallvargas/store_sql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Store SQL Database - MySQL

This repository contains the SQL scripts for an online store database. It includes the table structure, relationships, and triggers designed to maintain data integrity.
The main objective of this database is to manage multiple stores, track sales, employees, customers, products and generate detailed reports for business analysis.

📂 Repository Contents

  • store_sql: Script for creating the database and its tables, with the included triggers.
  • generate_report: SQL script to view different reports.

📊 Database Structure

The database diagram: diagram

📋 Store reports

✔ Generate reports that show the current status of each invoice, grouped by their status: pending, paid or cancelled.
✔ View the quantity and type of products sold as part of each invoice.
✔ Identify the invoices that were generated as a result of sales in each store.

⚙️ Implemented Triggers

Automatic Stock Update

Every time an order is placed, the stock of purchased products is automatically reduced.

Automatic Total Payment Calculation

The order total is automatically calculated when products are inserted into an invoice_id, additionally, a discount can be applied to each product, and the trigger handles the discount as well.

Author

Kendall Vargas

License

This project is created for practice purposes and is not intended for commercial use. No specific license is applied.

About

DB created simulating sales in different stores | Created with MySQL

Topics

Resources

Stars

Watchers

Forks

Contributors