SQL Project
Date of Submission : 9th April 2024
Project Title: Online Retail Database -
Project Descrip on:
You are tasked with designing and implemen ng a rela onal database for an online
retail store. The database should be able to manage informa on about customers,
products, orders, and inventory.
Requirements:
Database Design:
Design an appropriate schema for the database, including tables for customers,
products, orders, and inventory. Consider normaliza on principles to ensure data
integrity and minimize redundancy.
Define primary keys, foreign keys, and any necessary constraints.
Data Popula on:
Populate the tables with sample data. Generate realis c data for customers,
products, orders, and inventory. You can use online generators or manually create
sample data.
Queries:
Write SQL queries to retrieve the following informa on:
List all products available in the store.
List all customers who made a purchase.
Retrieve the total number of orders placed.
List all orders along with the customer details and product details.
Calculate the total sales revenue.
Iden fy the best-selling products.
Iden fy customers with the highest total spending.
Data Manipula on:
Write SQL statements to perform the following opera ons:
Add new products to the inventory.
Add new customers to the database.
Place new orders for exis ng customers.
Update inventory levels a er orders are placed.
Update customer informa on.
Advanced Queries:
1. Write more complex SQL queries to answer advanced ques ons such as:
2. List customers who have not made any purchases.
3. Iden fy products that are low in stock.
4. Calculate average order value.
5. Iden fy customers who made purchases in a specific me period.
Performance Op miza on:
Analyse the performance of your queries using query execu on plans.
Op mize any slow-performing queries by adding appropriate indexes or
restructuring the queries.
Documenta on:
Provide documenta on explaining the database schema, sample data, and how to
run the SQL queries.
Include descrip ons of each table, their rela onships, and the purpose of each query.
Deliverables:
SQL script files containing the database schema, sample data, and queries.
Documenta on file in PDF or Markdown format.