A Project Report on
Computer Hardware Shop Management System
Rukmani Birla Modern High School
Submitted By
Manan Lohiya
Under the Guidance of
Mr. Vikas Mahajan
PGT(Computer Science)
Department of Computer Science
Rukmani Birla Modern High School
Jaipur
CERTIFICATE
This is to certify that Manan Lohiya of Class XII D, Roll No. 16 has
successfully completed the investigatory project on the topic Car Sales
Management System under the guidance of Mr. Vikas Mahajan (PGT,
Computer Science) during the academic year 2024-25 in the partial
fulfillment of AISSCE Practical Examination conducted by CBSE.
Signature of Signature of Signature of
Internal Examiner External Examiner Candidate
School Seal
DECLARATION
I hereby declare that the project work entitled “Computer
Hardware Sales Management System” submitted to Department
of Computer Science, Rukmani Birla Modern High School,
Jaipur is prepared by me. All the coding is result of my personal
efforts.
Manan Lohiya
Class XII D
ACKNOWLEDGEMENT
I would like to express a deep sense of thanks and gratitude to my
project guide Mr. Vikas Mahajan Sir for guiding me immensely through
the course of the project. He always evinced keen interest in my work.
His constructive advice and constant motivation have been responsible
for the successful completion of this project.
My sincere thanks goes to Mrs. Anjana Kumar, our Principal Madam,
for her coordination in extending every possible support for completion
of this project.
I also thanks to my parents for their motivation and support. I must
thanks to my classmates for their timely help and support for
compilation of this project.
Last but not least, I would like to those who had helped directly or
indirectly towards the completion of this project.
Manan Lohiya
Class XII D
CONTENTS
1. Introduction
2. Imported files and used functions in Python
3. Table Created in MySQL
4. Coding
5. Output Scenes
6. Limitations and Enhancement
7. Bibliography
INTRODUCTION
The project is designed to keep records of computer hardware and customers
records in computer shop. A table named ‘Product’ in MySQL5.0 to store
information about computer hardware like Product Id, Product Name, Date of
Expiry.
One more table named customer1 in MySQL5.0 to store information about
customers like Customer Id, Product ID(referenced with product table), Quantity,
Price per quantity, Net Price, GST applied on net price and Total Price.
Administrator of the project can enter new record, display all/specific passenger
record; he can modify and delete a records in product table as well as customer1
table.
Files Imported in Project
1. Import MYSQL for database connectivity
Functions Used in Project
1. connect()- For Database and tables creation
2. displayp()- To Show all information of computer hardware stored in
product table.
3. insertp()- To insert new record about computer hardware in product
table.
4. showp()- To show particular information about a computer hardware in
product table.
5. deletep()- To delete record about computer hardware in product table.
6. updatec()- To update customer record in customer1 table.
7. displayc()- To show all information about customers stored in customer1
table.
8. insertc()- To insert new record about customer in customer1 table.
9. showc()- To show particular information about a customer in customer1
table.
10. deletec()- To delete customer information in customer1 table.
11. select()- To display menu options of project.
Tables Created in MySQL
PRODUCT
CUSTOMER1
CODING
import mysql.connector as sq
#PROGRAM FOR DATABASE CONNECTIVITY
def connect():
db=sq.connect(host='localhost',user='root')
cur=db.cursor()
cur.execute("create database IF NOT EXISTS cmshop11")
cur.execute("use cmshop11")
cur.execute("create table IF NOT EXISTS product (pid int primary key, pname varchar(20),doe date)")
cur.execute("create table IF NOT EXISTS customer1 (cid int primary key, prid int, qty int,price float,nprice float,
gst float, gprice float, foreign key (prid) references product(pid) on delete cascade)")
if db.is_connected==False:
print("notconnected")
return db
#PROGRAM FOR USING COMPUTER HARDWARE SHOP MANAGEMENT
def displayp():
con=connect()
cur=con.cursor()
cur.execute("select * from product")
data=cur.fetchall()
for i in data:
pid=i[0]
pname=i[1]
doe=i[2]
print ("Product Id is ", pid, "Product Name is ", pname, "Date of Expiry is ",doe)
def insertp():
pid=int(input("Enter Product Id- "))
pname=input("Enter Product Name:-")
doe=input("Enter Expiry Date as yyyy-dd-mm :-")
con=connect()
cur=con.cursor()
cur.execute("insert into product(pid,pname,doe)values({},'{}','{}')".format(pid,pname,doe))
con.commit()
def showp():
pid=int(input("Enter Product Id- "))
con=connect()
cur=con.cursor()
cur.execute("select * from product where pid=%d"%(pid))
data=cur.fetchall()
for row in data:
pid=row[0]
pname=row[1]
doe=row[2]
print ("Product Id is ", pid, "Product Name is ", pname, "Date of Expiry is ",doe)
def deletep():
try:
con=connect()
cur=con.cursor()
pid=int(input("ENTER Product No. TO BE DELETED:-"))
ans=input("ARE YOU SURE YOU WANT TO DELETE(y/n):-")
if ans=='y' or ans=='Y':
cur.execute("delete from product where pid=%d"%(pid))
con.commit()
except:
print("Delete Record From Child Table First. Try Again!!!!!!!!!!")
def displayc():
con=connect()
cur=con.cursor()
cur.execute("select * from customer1")
data=cur.fetchall()
for i in data:
cid=i[0]
prid=i[1]
qty=i[2]
pprice=i[3]
nprice=i[4]
gst=i[5]
gprice=i[6]
print("Customer Id is ", cid, "Product Id is ", prid, "Quantity Purchased is ",qty, "Price Per Quantity is ",pprice,
" Net Price is ",nprice, "GST is ", gst, "Gros/Total Price is ",gprice)
def insertc():
try:
cid=int(input("Enter Customer Id- "))
prid=int(input("Enter Product Id (Product Id must be present in Product Table):- "))
qty=int(input("Enter Qty To Purchase:- "))
pprice=float(input("Enter Price per quantity:- "))
nprice=pprice *qty
gst=float(input("Enter GST In Percentage - "))
gprice= (nprice+(nprice)*gst/100)
con=connect()
cur=con.cursor()
cur.execute("insert into customer1(cid,prid,qty,price, nprice,gst,gprice)values('%d','%d','%d', '%f','%f',
'%f','%f')"%(cid,prid,qty,pprice,nprice,gst,gprice))
con.commit()
except:
print("Insert Record in Product Table First ")
def showc():
cid=int(input("Enter Customer Id- "))
con=connect()
cur=con.cursor()
cur.execute("select * from customer1 where cid=%d"%(cid))
data=cur.fetchall()
for i in data:
cid=i[0]
prid=i[1]
qty=i[2]
pprice=i[3]
nprice=i[4]
gst=i[5]
gprice=i[6]
print("Customer Id is ", cid, "Product Id is ", prid, "Quantity Purchased is ",qty, "Price Per Quantity is ",pprice,
" Net Price is ",nprice, "GST is ", gst, "Gros/Total Price is ",gprice)
def deletec():
con=connect()
cur=con.cursor()
cid=int(input("ENTER Customer No. To be Deleted:-"))
ans=input("ARE YOU SURE YOU WANT TO DELETE(y/n):-")
if ans=='y' or ans=='Y':
cur.execute("delete from customer1 where cid=%d"%(cid))
con.commit()
def updatec():
con=connect()
cur=con.cursor()
cid=int(input("Enter Customer No. To be Updtated " ))
cur.execute("select * from customer1 where cid=%d"%(cid))
data1=cur.fetchall()
for i in data1:
cid=i[0]
prid=i[1]
qty=i[2]
pprice=i[3]
nprice=i[4]
gst=i[5]
gprice=i[6]
print("Customer Id is ", cid, "Product Id is ", prid, "Price Per Quantity is ",pprice)
pprice=float(input("Enter New Price for the Product "))
cur.execute("update customer1 set price=%f where cid=%d"%(pprice,cid))
con.commit()
def select():
anss='y'
print("-----------------------WELCOME TO COMPUTER HARDWARE SHOP MANAGEMENT-------------------------")
print("----------------------It is mandatory to enter records in Product Management First ")
print("1. PRODUCT MANAGEMENT")
print("2. CUSTOMER MANAGEMENT")
ch=int(input("Enter your choice(1-2):-"))
if ch==1:
print("\nEXISTING RECORDS ARE\n")
displayp()
while(anss=='y'):
print("\n------------------WELCOME TO PRODUCT MANAGEMENT------------------\n")
print("a. Insert New Product")
print("b. Show Particular Products")
print("c. Delete Product Details")
print("d. Exit")
c=input("enter your choice(a-d):-")
if c=='a':
insertp()
print("Inserted Records Are")
displayp()
elif c=='b':
showp()
elif c=='c':
deletep()
print("\nMODIFIED DETAILS ARE:-\n")
displayp()
elif c=='d':
break
else:
print("Wrong Choice.........")
anss=input("Want to Continue ")
elif ch==2:
ansc='y'
print("\nEXISTING RECORDS IN PRODUCT TABLE ARE\n")
displayc()
while(ansc=='y'):
print("\n------------------WELCOME TO CUSTOMER MANAGEMENT------------------\n")
print("a. Insert New Customer Record")
print("b. Show Particular Customer Record")
print("c. Delete Customer Record")
print("d. Update Customer Record")
print("e. Exit")
c=input("enter your choice(a-e):-")
if c=='a':
print("List of Products Available")
displayp()
insertc()
print("Inserted Records Are")
displayc()
elif c=='b':
showc()
elif c=='c':
deletec()
print("\nMODIFIED DETAILS ARE:-\n")
displayc()
elif c=='d':
updatec()
displayc()
elif c=='e':
break
else:
print("Wrong Choice.........")
ansc=input("Want to Continue ")
select()
OUTPUT
Main Screen
1. Enter Product Details
2. Insert New Product
3. Show Particular Record
4. Delete Record
Customer Details
Insert New Customer Record
Show Particular Customer Record
Update Customer Record
Delete Customer Record
Limitations and Enhancement
Limitations:
1. Printing facility is not available.
Enhancement:
1. Printing facility code can be generated.
BIBLIOGRAPHY
1. www.google.com
2. Computer Science With Python Book By Sumita Arora
3. https://www.w3schools.com/python