This repository contains SQL scripts to create and manage the TechShop database, a backend for an electronic gadget store. It includes tables for customers, products, orders, order details, and inventory, along with sample data to test queries.
The database structure is designed to support CRUD operations and can be integrated with Python or other applications for real-world store management.
TechShop/ βββ create_database.sql # Creates the TechShop database βββ create_tables.sql # Creates all tables with constraints βββ insert_data.sql # Inserts sample data into tables βββ select_queries.sql # Example queries to fetch data
-
Customers
Stores customer information with unique emails and phone numbers. -
Products
Stores product information including name, description, and price. -
Orders
Stores customer orders with foreign key references to Customers. -
OrderDetails
Stores product details for each order with foreign keys to Orders and Products. -
Inventory
Tracks product stock levels and last stock updates.
- Clone the repository:
git clone https://github.com/Manojsv20/sql.git
2.Open MySQL and run the scripts in this order:
create_database.sql
create_tables.sql
insert_data.sql
3.Use select_queries.sql to test sample queries and data retrieval.
π Technologies Used
MySQL
SQL Queries for CRUD operations
Sample data for testing
β Notes
This database can be integrated with Python (using mysql-connector-python) or any other programming language for full application development.
Tables include proper foreign key constraints to maintain relational integrity.