INDEX
[Link]. TOPIC
1. Introduction
2. Scope of Project
3. Why This Project??
4. Data Flow Diagram
5. Coding
6. Output
7. Bibliography
INTRODUCTION
The project “Cosmetic Management System” is an innovative
Computer Science project developed by Deepanshi Sahay and
Paridhi Garg of Class XII-A under the CBSE curriculum. The
main objective of this project is to design a simple, efficient, and user-
friendly system that helps in managing cosmetic products in a store or
inventory setup.
This system has been created using the interfacing of Python and
MySQL, where Python is used for the program's front-end operations
and user interaction, while MySQL is used as the back-end database
to store and manage product records securely. The project allows
users to perform essential operations such as adding new products,
updating stock and prices, searching for items, deleting records, and
displaying the complete inventory.
By combining Python's logical programming capabilities with
MySQL’s data handling features, this project demonstrates how
computerized systems can replace manual record-keeping, reduce
errors, save time, and ensure accurate management of information.
This project has been successfully completed under the guidance of
Mrs. Seema Sharma, whose support and supervision played an
important role in shaping and refining the system. The development
of this project has helped the students enhance their knowledge of
database connectivity, file handling, logical thinking, and real-world
application of programming concepts.
SCOPE OF PROJECT
The Cosmetic Management System has a wide scope in simplifying and
digitalizing the management of cosmetic products. This project focuses on
creating a computerized platform that can store, update, and retrieve product
information efficiently. It aims to replace manual record-keeping with a faster,
accurate, and organized system.
The system allows users to:
Add new cosmetic products along with details such as name, brand, price,
and stock.
Update existing information like price changes and stock availability.
Search for any product quickly through the database.
Delete outdated or unavailable product records.
Display the complete list of products in a systematic manner.
Since the project is developed using Python and MySQL interfacing, it
demonstrates how real-time data can be handled securely and effectively. The
scope of this system can be further extended to include features like billing,
customer records, sales tracking, and report generation, making it useful for
cosmetic shops, wholesalers, and inventory units.
Overall, the project showcases how technology can be used to improve store
management, reduce errors, save time, and support decision-making in the
cosmetic industry.
WHY THIS PROJECT??
We chose the project “Cosmetic Management System” because cosmetics are
widely used in daily life, and shops often face difficulties in managing product
stock, pricing, and availability. Most cosmetic stores still depend on manual
registers, which can lead to errors, misplaced information, and time-consuming
record-keeping. We wanted to create a simple digital solution that could make
this process faster and more accurate.
This project also gave us the opportunity to apply our learning of Python and
MySQL interfacing in a practical way. By developing this system, we were
able to understand how real databases work, how data can be stored and
retrieved, and how programming can solve real-world problems.
Another reason for choosing this topic was its future usefulness. The cosmetic
industry is growing rapidly, and an automated management system can help
shopkeepers, wholesalers, and businesses maintain inventory more efficiently.
Overall, we selected this project because it is:
Practical and related to real-life needs
Helpful in reducing manual workload and errors
A good way to apply programming and database skills
Simple to use, yet meaningful and impactful
This topic allowed us to learn, explore, and build something useful under the
guidance of Mrs. Seema Sharma, making it a valuable project experience.
DATA FLOW DIAGRAM
+------------------+
| USER |
| (Admin/Customer) |
+--------+---------+
|
| Inputs / Requests
v
+----------------------------+
| COSMETIC MANAGEMENT SYSTEM |
+----------------------------+
|
| Outputs / Results
v
+----------------------+
| DATABASE (MySQL) |
+----------------------+
USER
|
v
+------------------------+
| 1. ADMIN MODULE |
+-----------+------------+
|
| Manage Products & Sales
v
+-----------------------------------------------+
| PRODUCT DATABASE / SALES DATABASE
(MySQL) |
+-----------------------------------------------+
^
|
|
USER
|
v
+------------------------+
| 2. CUSTOMER MODULE |
+-----------+------------+
|
| View, Purchase, Billing
v
+-----------------------------------------------+
| PRODUCT DATABASE / CUSTOMER
DATABASE (MySQL) |
+-----------------------------------------------+
^
|
|
USER
|
v
+------------------------+
| 3. EMPLOYEE MODULE |
+-----------+------------+
|
| View/Update Employee
Records
v
+-----------------------------------------------+
| EMPLOYEE DATABASE (MySQL)
|
+-----------------------------------------------+
ADMIN
|
v
+------------------------+
| 1. Add Product |
+-----------+------------+
|
v
PRODUCT DATABASE
^
|
+-----------+------------+
| 2. Delete Product |
+-----------+------------+
|
v
PRODUCT DATABASE
^
|
+-----------+------------+
| 3. Update Stock/Price |
+-----------+------------+
|
v
PRODUCT DATABASE
^
|
+-----------+------------+
| 4. View Sales Summary |
+-----------+------------+
|
v
SALES DATABASE
CUSTOMER
|
v
+-------------------------+
| 1. View Products |
+-----------+-------------+
|
v
PRODUCT DATABASE
|
v
+-------------------------+
| 2. Billing / Purchase |
+-----------+-------------+
|
v
PRODUCT DATABASE ----> CUSTOMER
DATABASE
| |
v v
STOCK UPDATE PURCHASE
RECORD
ADMIN
|
v
+-------------------------+
| 1. View Employees |
+-----------+-------------+
|
v
EMPLOYEE DATABASE
|
v
+-------------------------+
| 2. Update Salary |
+-----------+-------------+
|
v
EMPLOYEE DATABASE
CODING
import pymysql as c
con = [Link](host="localhost",user="root",passwd="admin",database="cosmetic")
cur=[Link]()
from tabulate import tabulate
def add_product():
print("\n--- Add New Product ---")
while True:
pid=int(input("Enter product_id: "))
q0="SELECT * FROM cosmetic_products WHERE product_id={}".format(pid)
[Link](q0)
d=[Link]()
if d:
print("Product ID already exists! Please choose another one.")
else:
break
product=input("Enter product name: ")
brand=input("Enter brand name: ")
price=int(input("Enter price: "))
category=input("Enter category (skin/hair/lips/eyes/nails/fullbody): ")
quantity=int(input("Enter quantity: "))
q="INSERT INTO
cosmetic_products(product_id,product_name,brand_name,price,category,quantity)
VALUES ({},'{}','{}',{},'{}',{})".format(pid,product,brand,price,category,quantity)
[Link](q)
[Link]()
print("Your Product has been added successfully!")
def view_products():
print("\n--- Product List ---")
q="SELECT * FROM cosmetic_products"
[Link](q)
d=[Link]()
if len(d)==0:
print("No products found.")
else:
headers=["Product_ID","Product Name","Brand","Price","Category","Stock"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def bill():
items=[]
print("\nWELCOME TO COSMETIC SHOP BILLING")
print("-"*60)
ci=input("Enter Customer ID: ")
q="SELECT Customer_id FROM customer_details WHERE Customer_id={}".format(ci)
[Link](q)
d=[Link]()
if d:
print("\nWelcome back, {}!".format(d[1]))
else:
print("New customer record!")
date=input("Enter date:")
while True:
pid=int(input("Enter Product-ID: "))
q1="SELECT * FROM cosmetic_products WHERE product_id={}".format(pid)
[Link](q1)
d=[Link]()
if d:
pid,item,brand,price,cat,stock=d
print("Selected:",item,"by",brand,"Price: Rs.",price,"Available:",stock)
else:
print("Product not found! Please try again.")
continue
qty=int(input("Enter Quantity: "))
if qty>stock:
print("Quantity exceeds available stock! Only",stock,"left.")
continue
n=stock-qty
q2="UPDATE cosmetic_products SET quantity={} WHERE product_id={}".format(n,pid)
[Link](q2)
[Link]()
[Link]([item,brand,qty,price])
Total_price=qty*price
q3="INSERT INTO
customer_details(Customer_id,Product,Brand,Quantity_purchased,Total_price,Date)
VALUES('{}','{}','{}',{}, {},'{}')".format(ci,item,brand,qty,price,date)
[Link](q3)
[Link]()
q4="UPDATE business SET Total_annual_sales=Total_annual_sales+{} WHERE Brand='{}'
AND Category='{}'".format(Total_price,brand,cat)
[Link](q4)
[Link]()
more=input("Would you like to add more items? (yes/no): ").lower()
if more!="yes":
break
print("\n"+" "*5+"YOUR BILL IS HERE!")
print("*"*45)
print(" "*5,"COSMETIC SHOP BILL")
print("-"*45)
print(" "*3,"{} {} {} {}".format("Item","Qty","Rate","Total"))
print("-"*45)
total=0
for i in items:
item,brand,qty,price=i
t=qty*price
total+=t
print(" "*3,"{} {} {} {}".format(item,qty,price,t))
print("-"*45)
print(" "*10,"Grand Total: Rs.",total)
print("="*45)
print("Thank You!")
print("Visit Again")
print("="*45)
def view_customers():
print("\n--- Customer Records ---")
q="SELECT * FROM customer_details"
[Link](q)
d=[Link]()
headers=["CID","Name","Brand","Product","Qty","Price","Date","Email","Phone"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def view_sales_summary():
print("\n--- Overall Sales Summary ---")
q="SELECT * FROM business"
[Link](q)
d=[Link]()
headers=["Brand","Category","Price"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def view_category_sales():
cat=input("please enter your category(eyes,lips,fullbody,hair,nails,skin): ")
q="SELECT * FROM business WHERE category='{}'".format(cat)
[Link](q)
d=[Link]()
headers=["Brand","Category","Price"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def emp():
q="SELECT * FROM Employee"
[Link](q)
d=[Link]()
headers=["Employee_ID","Date_of_joining","Salary","Total_sales"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def Update_Employee():
print("\n--- Update Employee details ---")
Emp_id=int(input("Enter Employee ID: "))
inc=float(input("Enter salary increment percentage %: "))
q="UPDATE Employee SET Salary=Salary+({}*Salary/100) WHERE
Employee_id={}".format(inc,Emp_id)
[Link](q)
[Link]()
print("Your salary has been successfully updated!")
def delete():
pid=int(input("Enter Product ID to delete: "))
q="SELECT * FROM cosmetic_products WHERE product_id={}".format(pid)
[Link](q)
d=[Link]()
if d:
print("You are about to delete:",d[1],"by",d[2])
c=input("Are you sure? (yes/no): ").lower()
if c=="yes":
q="DELETE FROM cosmetic_products WHERE product_id={}".format(pid)
[Link](q)
[Link]()
print("Product has been deleted successfully!")
else:
print("OK! Deletion cancelled.")
else:
print("No product found with that ID.")
def update_product(field,new_value,pid):
q="UPDATE cosmetic_products SET {}={} WHERE
product_id={}".format(field,new_value,pid)
[Link](q)
[Link]()
print("Field updated successfully.")
def searchc():
cid=int(input("Enter Customer ID: "))
q="SELECT * FROM customer_details WHERE Customer_id={}".format(cid)
[Link](q)
d=[Link]()
print("Data of the customer whose ID is given:")
headers=["C_ID","Name","Brand","Product","Qty","Price","Date","Email","Phone"]
print(tabulate(d,headers=headers,tablefmt="psql"))
def main_menu():
while True:
print("=" * 115)
print(" " * 40 + "COSMETIC MANAGEMENT SYSTEM")
print("=" * 115)
print()
print("Prepared By : Deepanshi Sahay and Paridhi Garg")
print("Class : XII - A")
print("Session : 2025-2026")
print("Guide : Mrs. Seema Sharma (Computer Science Teacher)")
print("-" * 115)
print("Front-End : Python")
print("Back-End : MySQL")
print("Description : A database-driven management system to manage")
print(" products, customers, employees and sales.")
print("=" * 115)
print("Welcome to our Cosmetic Management System")
print("This program helps manage cosmetics, employees, customers and sales.")
print("It keeps records in a better and more accurate way.")
print("=" * 115)
print()
input("Press Enter to continue...")
print("\nWELCOME TO OUR COSMETIC SHOP")
print("HOW CAN WE HELP YOU TODAY?\n")
menu_data = [
["1", "Admin Window"],
["2", "Customer Window"],
["3", "Manage Employee"],
["4", "Exit"]
]
print(tabulate(menu_data, headers=["Choice", "Menu Option"],
tablefmt="fancy_grid"))
choice = input("Enter your choice: ")
if choice == '1':
admin_window()
elif choice == '2':
customer_window()
elif choice == '3':
Manage_Employee()
elif choice == '4':
print("\nThank you for visiting our Cosmetic Shop.")
print("Have a beautiful day!")
break
else:
print("Invalid choice, please try again.")
def admin_window():
while True:
print("\n========== ADMIN WINDOW ==========")
print("1. Add New Product")
print("2. Delete Product")
print("3. Update Stock/Price")
print("4. View Overall Sales")
print("5. View Category Sales")
print("6. Back to Main Menu")
ch=input("Enter your choice: ")
if ch=='1':
add_product()
elif ch=='2':
delete()
elif ch=='3':
print("1. Update Price")
print("2. Update Stock")
ch=int(input("Enter your choice: "))
if ch==1:
pid=int(input("Enter Product ID: "))
new_price=float(input("Enter new price: "))
update_product("price",new_price,pid)
elif ch==2:
pid=int(input("Enter Product ID: "))
new_stock=int(input("Enter new stock: "))
update_product("quantity",new_stock,pid)
elif ch=='4':
view_sales_summary()
elif ch=='5':
view_category_sales()
elif ch=='6':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please use a valid option.")
def customer_window():
while True:
print("\n========== CUSTOMER WINDOW ==========")
print("1. View All Products Available in the Shop")
print("2. Billing")
print("3. View Customer Details")
print("4. Search Customer Details")
print("5. Back to Main Menu")
ch=input("Enter your choice: ")
if ch=='1':
view_products()
elif ch=='2':
try:
[Link]()
except:
pass
bill()
elif ch=='3':
view_customers()
elif ch=='4':
searchc()
elif ch=='5':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please use a valid option.")
def Manage_Employee():
while True:
print("\n========== MANAGE EMPLOYEE ==========")
print("1. View Employee Records")
print("2. Update Employee Salary")
print("3. Return to Main Menu")
ch = input("Enter your choice: ")
if ch == '1':
emp()
elif ch == '2':
Update_Employee()
elif ch == '3':
print("Returning to Main Menu...")
break
else:
print("Invalid choice. Please use a valid option.")
main_menu()
OUTPUT
…………..ADDING PRODUCT………..
............DELETING PRODUCT…………
……………..UPDATING PRICE……………..
…………….UPDATING STOCK…………….
……………VIEW OVERALL SALES………….
………………….VIEW CATEGORY SALES………..
…………………RETURN TO BACK MENU……….
………………VIEW ALL PRODUCTS………………
……………..BILLING…………..
…………….VIEW CUSTOMER DETAILS……….
…………….SEARCH CUSTOMER DETAILS…………
……………….VIEW EMPLOYEE RECORDS…………..
…………….INCREMENT SALARY…………..
……………EXIT………….
BIBLIOGRAPHY
Books & Textbooks
Sumita Arora, Computer Science with Python, Class XII, Dhanpat Rai
Publications.
K. R. Venugopal, MySQL: Introduction to Database Management, Tech
Publications.
NCERT, Informatics Practices, Class XII, National Council of
Educational Research and Training.
Web Resources
[Link] – Official documentation for Python programming.
[Link] – Official MySQL reference and features.
[Link] – Tutorials on Python and MySQL commands.
[Link] – References for Python functions and database
connectivity.
Software & Tools
Python 3.11 (IDLE Environment) – For program development.
MySQL / XAMPP / MySQL Workbench – For database creation and
execution.
PyMySQL Library – For establishing Python–MySQL connectivity.