Project
Project
SCIENCE PROJECT
P a g e 1 | 23
Declaration
I hereby declare that this project, titled "Car Showroom
Management System," is my original work and has not been
submitted for any other course or program. All references and
sources of information have been duly acknowledged. This
project has been completed with adherence to academic
integrity and honesty. I have consulted various resources,
including books, articles, and online databases, to ensure a
comprehensive understanding of the topic. I take full
responsibility for the content and findings presented in this
project, and I affirm that I have not engaged in any form of
plagiarism in the creation of this work.
P a g e 2 | 23
Acknowledgement
P a g e 3 | 23
NAME
CLASS
SCHOOL
TITLE
TEACHER INCHARGE
GROUP MEMBER
TIME FOR COMPLETION
SUBMISSION DATE
PROJECT PLAN
P a g e 4 | 23
Introduction
The "Car Showroom Management System" is a
comprehensive application designed to manage various
aspects of a car showroom. This system facilitates the storage
and retrieval of data related to car inventory, customer details,
employee records, and sales transactions. By utilizing a
MySQL database, the system ensures efficient data
management and provides users with a user-friendly interface
to perform various operations. It features robust reporting
tools that allow showroom managers to analyze sales trends
and inventory levels effectively. Additionally, a secure login
mechanism protects sensitive information and restricts access
to authorized personnel only. With multi-user functionality,
the application enables seamless collaboration among
employees while maintaining data integrity.
P a g e 5 | 23
Objective
The primary objectives of the Car Showroom Management
System are:
1. To maintain an organized database for managing car
inventory, customers, employees, and sales records.
2. To provide functionalities for adding, displaying, and
modifying records within the database.
3. To ensure data integrity through the use of foreign keys and
constraints in the database schema.
4. To offer a simple menu-driven interface that enhances user
experience and accessibility.
P a g e 6 | 23
Code
ch = 'y'
while ch.lower() == 'y':
print('*' * 40)
print("1. GO TO CAR INVENTORY")
print("2. GO TO CUSTOMER DETAILS")
print("3. GO TO EMPLOYEE DETAILS")
print("4. GO TO SALE DETAILS")
print("5. EXIT THE DATABASE")
print('*' * 40)
P a g e 7 | 23
zx = int(input("Enter choice: "))
if zx == 1:
cur.execute("USE cmi")
cur.execute("""
CREATE TABLE IF NOT EXISTS Inventory (
CarID VARCHAR(25) PRIMARY KEY,
Car_name VARCHAR(35),
Price INT,
Model VARCHAR(35),
YOM DATE,
Fuel_Type VARCHAR(35)
);
""")
con.commit()
print("Table created")
while True:
print('*' * 40)
print("1. ADD RECORD")
P a g e 8 | 23
print("2. DISPLAY RECORD")
print("3. MODELS AVAILABLE WITH PRICE")
print("4. NO OF CARS AVAILABLE")
print("5. MODIFY INVENTORY DETAILS")
print("6. RETURN TO MENU")
print('*' * 40)
choice = int(input("Enter choice: "))
if choice == 1:
i = input("Car id: ")
n = input("Car name: ")
p = int(input("Price: "))
m = input("Car model: ")
y = input("Enter date of manufacture (YYYY-MM-
DD): ")
f = input("Enter fuel type: ")
P a g e 9 | 23
con.commit()
print("##Data Saved##")
elif choice == 2:
cur.execute("SELECT * FROM Inventory;")
result = cur.fetchall()
print('CAR ID\tCAR N\tCAR PRI\tMODEL\tYear Of
Manu\tFUEL T')
for row in result:
print(row[0],'\t',row[1],'\t',row[2],'\t',row[3],'\
t',row[4],'\t',row[5])
elif choice == 3:
cur.execute("SELECT Car_name, Model, Price FROM
Inventory;")
result = cur.fetchall()
print('Car_N \t Models \t Price')
for row in result:
print(row[0],'\t',row[1],'\t',row[2])
elif choice == 4:
P a g e 10 | 23
cur.execute("SELECT COUNT(*) FROM Inventory;")
result = cur.fetchone()
print("No of cars available in car showroom is:",
result[0])
elif choice == 5:
eno=input("Enter carid to update: ")
query="select * from inventory where
carid='{}'".format(eno)
cur.execute(query)
result=cur.fetchall()
if cur.rowcount==0:
print("Sorry! car id not found")
else:
print("CAR ID\tCAR N\tCAR PRI\tMODEL\tYear Of
Manu\tFUEL T")
for row in result:
print(row[0],'\t',row[1],'\t',row[2],'\t',row[3],'\
t',row[4],'\t',row[5])
choice=input("\nAre you sure to update?[y/n]:
")
P a g e 11 | 23
if choice.lower()=="y":
print("You can only update price")
d=input("Enter new price: ")
if d=="":
d=row[2]
query="update inventory set price='{}' where
carid='{}'".format(d,eno)
cur.execute(query)
con.commit()
print("##Record Saved###")
elif choice == 6:
break
elif zx == 2:
cur.execute("USE cmi")
cur.execute("""
CREATE TABLE IF NOT EXISTS Customer (
Cust_ID VARCHAR(25) PRIMARY KEY,
Cust_Name VARCHAR(35),
Cust_Add VARCHAR(35),
P a g e 12 | 23
Email VARCHAR(35)
);
""")
con.commit()
print("Table created")
while True:
print('*' * 40)
print("1. ADD RECORD")
print("2. DISPLAY RECORD")
print("3. NO OF CUSTOMERS")
print("4. RETURN TO MENU")
print('*' * 40)
choice = int(input("Enter choice: "))
if choice == 1:
i = input("Cust Id: ")
n = input("Cust name: ")
p = input("Cust Address: ")
y = input("Email: ")
P a g e 13 | 23
query = "INSERT INTO Customer (Cust_ID,
Cust_Name, Cust_Add, Email) VALUES (%s, %s, %s, %s)"
cur.execute(query, (i, n, p, y))
con.commit()
print("##Data Saved##")
elif choice == 2:
cur.execute("SELECT * FROM Customer;")
result = cur.fetchall()
print('CUST_ID\tCUST_N\tCUST_AD\tEMAIL')
for row in result:
print(row[0],'\t',row[1],'\t',row[2],'\t',row[3])
elif choice == 3:
cur.execute("SELECT COUNT(*) FROM Customer;")
result = cur.fetchone()
print("No of customers:", result[0])
elif choice == 4:
break
elif zx == 3:
P a g e 14 | 23
cur.execute("USE cmi")
cur.execute("""
CREATE TABLE IF NOT EXISTS Employee (
EMPID VARCHAR(25) PRIMARY KEY,
EMP_NAME VARCHAR(35),
DOB DATE,
DOJ DATE,
DESIGNATION VARCHAR(35),
NOCS int,
Salary int
);
""")
con.commit()
print("Table Created")
while True:
print("*" * 40)
print("1. ADD RECORD")
print("2. DISPLAY RECORD")
print("3. MODIFY CUSTOMER DETAILS")
P a g e 15 | 23
print("4. RETURN TO MENU")
print("*" * 40)
choice = int(input("Enter your choice: "))
if choice == 1:
a = input("Enter EMPID: ")
b = input("Enter EMP Name: ")
c = input("Enter DOB (YYYY-MM-DD): ")
d = input("Enter DOJ (YYYY-MM-DD): ")
e = input("Enter Designation: ")
g=int(input("Enter the no of cars sold by the
employee: "))
f = int(input("Enter Salary: "))
P a g e 16 | 23
elif choice == 2:
cur.execute("SELECT * FROM Employee;")
result = cur.fetchall()
print("EMPID\tEMP_N\tD-OF-BIRTH\tD-OF-JOIN\
tDESIG\tUnits_S\tSalary")
for row in result:
print(row[0],'\t',row[1],'\t',row[2],'\t',row[3],'\
t',row[4],'\t',row[5],'\t',row[6])
elif choice==3:
eno=input("Enter employee id to update: ")
query="select * from employee where
empid='{}'".format(eno)
cur.execute(query)
result=cur.fetchall()
if cur.rowcount==0:
print("Sorry! employee id not found")
else:
print("EMPID\tEMP_N\tD-OF-BIRTH\tD-OF-JOIN\
tDESIG\tUnits_S\tSalary")
for row in result:
P a g e 17 | 23
print(row[0],
OUTPUT
P a g e 18 | 23
P a g e 19 | 23
P a g e 20 | 23
P a g e 21 | 23
P a g e 22 | 23
P a g e 23 | 23