Car Management
Car Management
VIHAR
SESSION: 2021-22
Computer Science
CLASS XII PROJECT
ON
CAR MANAGEMENT SYSTEM
Date:11/01/22
R.No:14632262
Signature Signature
(Subject Teacher) (External Examiner)
ACKNOWLEDGEMENT
It would be my utmost pleasure to
thank my Computer Science teacher
Ms. Jaity Kautilya for giving me this
knowledgeable topic "CAR
MANAGEMENT SYSTEM" and
supporting me during the course of
this project.
Hardware and Software
Requirements
mycon=sqltor.connect(host="localhost",user="root",passwd="",data
base="MANAGEMENT")
if mycon.is_connected():
print("Successfully connected to MYSQL")
return mycon
def read():
con=connection()
cursor=con.cursor()
cursor.execute("select * from MANAGEMENT")
data=cursor.fetchall()
count=cursor.rowcount
print("Total number of rows retrieved: ",count)
for row in data:
print(row)
def write(a,n,m,c,b):
con=connection()
cursor=con.cursor()
st="insert into MANAGEMENT
values({},'{}',{},'{}',{})".format(a,n,m,c,b)
cursor.execute(st)
con.commit()
def search(s):
con=connection()
cursor=con.cursor()
if s==1:
a=int(input("Please enter the cust_ID:"))
st="select * from MANAGEMENT where cust_ID ={}".format(a)
elif s==2:
n=input("Please enter the cust_name :")
st="select * from MANAGEMENT where cust_name
='{}'".format(n)
elif s==3:
c=input("Please enter the car_booked :")
st="select * from MANAGEMENT where car_booked
='{}'".format(c)
cursor.execute(st)
data=cursor.fetchall()
for row in data:
print(row)
def update(b):
con=connection()
cursor=con.cursor()
id=int(input("Enter the cust_ID on which you need a change:"))
if b==1:
val=input("Please enter the changed cust_name : ")
st="update management set cust_name ='{}' where cust_ID
={}".format(val,id)
elif b==2:
val=int(input("Please enter the changed mobile_no : "))
st="update management set mobile_no={} where cust_ID
={}".format(val,id)
elif b==3:
val=str(input("Please enter the changed car_booked : "))
st="update management set car_booked ='{}' where cust_ID
={}".format(val,id)
elif b==4:
val=int(input("Please enter the changed amount_paid : "))
st="update management set amount_paid ={} where cust_ID
={}".format(val,id)
cursor.execute(st)
con.commit()
def remove(num):
con=connection()
cursor=con.cursor()
st="delete from MANAGEMENT where cust_ID ={}".format(num)
cursor.execute(st)
con.commit()
ch='y'
while ch=='y'or ch=='Y':
print("MAIN MENU")
print("1.READ RECORD/RECORDS")
print("2.WRITING RECORD/RECORDS")
print("3.SEARCH RECORD DETAILS")
print("4.UPDATE RECORD/RECORDS ")
print("5.DELETE RECORD/RECORDS")
choice=int(input("enter ur choice(1 to 5)"))
if choice==1:
read()
elif choice==2:
id=int(input("ENTER cust_ID : "))
cust_name =str(input("ENTER cust_name : "))
mob=int(input("ENTER mobile_no : "))
car_booked =str(input("ENTER car_booked : "))
idb=int(input("ENTER amount_paid :"))
write(id,cust_name ,mob,car_booked ,idb)
elif choice==3:
print("on the basis of: ")
print("1.cust_ID ")
print("2. cust_name ")
print("3. car_booked ")
s=int(input("Please enter your choice (1,2 OR 3):"))
search(s)
elif choice==4:
print("What you would like to update: ")
print("1. cust_name ")
print("2. mobile_no ")
print("3. car_booked ")
print("4. amount_paid ")
b=int(input("Your choice is (1 to 4): "))
update(b)
elif choice==5:
aid=int(input("Please enter the cust_ID you want to
remove:"))
remove(aid)
else:
print("invalid choice choose between 1 to 5")
ch=str(input("do you want to continue(y/n):"))
OUTPUT
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)1
Successfully connected to MYSQL
Total number of rows retrieved: 5
(681, 'ajay', 9810912534, 'alto800 ', 500000)
(682, 'bhawna ', 9810474637, 'creta', 677000)
(683, 'disha', 9810915234, 'porche', 937000)
(684, 'kiahore', 9999941444, 'swift', 65000)
(685, 'ram', 8655743922, 'mustang', 89000)
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)2
ENTER cust_ID : 506
ENTER cust_name : shreya
ENTER mobile_no : 8787656543
ENTER car_booked : BMW
ENTER amount_paid :90043
Successfully connected to MYSQL
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)3
on the basis of:
1.cust_ID
2. cust_name
3. car_booked
Please enter your choice (1,2 OR 3):1
Successfully connected to MYSQL
Please enter the cust_ID :683
(683, 'disha', 9810915234, 'porche', 937000)
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)3
on the basis of:
1.cust_ID
2. cust_name
3. car_booked
Please enter your choice (1,2 OR 3):2
Successfully connected to MYSQL
Please enter the cust_name :ram
(685, 'ram', 8655743922, 'mustang', 89000)
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)3
on the basis of:
1.cust_ID
2. cust_name
3. car_booked
Please enter your choice (1,2 OR 3):3
Successfully connected to MYSQL
Please enter the car_booked :BMW
(506, 'shreya', 8787656543, 'BMW', 90043)
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)4
What you would like to update:
1. cust_name
2. mobile_no
3. car_booked
4. amount_paid
Your choice is (1 to 4): 1
Successfully connected to MYSQL
Enter the cust_ID on which you need a change:683
Please enter the changed cust_name : divya
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)4
What you would like to update:
1. cust_name
2. mobile_no
3. car_booked
4. amount_paid
Your choice is (1 to 4): 2
Successfully connected to MYSQL
Enter the cust_ID on which you need a change:506
Please enter the changed mobile_no : 98999944411
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)4
What you would like to update:
1. cust_name
2. mobile_no
3. car_booked
4. amount_paid
Your choice is (1 to 4): 3
Successfully connected to MYSQL
Enter the cust_ID on which you need a change:685
Please enter the changed car_booked : wagonar
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)4
What you would like to update:
1. cust_name
2. mobile_no
3. car_booked
4. amount_paid
Your choice is (1 to 4): 4
Successfully connected to MYSQL
Enter the cust_ID on which you need a change:684
Please enter the changed amount_paid : 999990
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)5
Please enter the cust_ID you want to remove:506
Successfully connected to MYSQL
do you want to continue(y/n):y
MAIN MENU
1.READ RECORD/RECORDS
2.WRITING RECORD/RECORDS
3.SEARCH RECORD DETAILS
4.UPDATE RECORD/RECORDS
5.DELETE RECORD/RECORDS
enter ur choice(1 to 5)1
Successfully connected to MYSQL
Total number of rows retrieved: 5
(681, 'ajay', 9810912534, 'alto800 ', 500000)
(682, 'bhawna ', 9810474637, 'creta', 677000)
(683, 'divya', 9810915234, 'porche', 937000)
(684, 'kiahore', 9999941444, 'swift', 999990)
(685, 'ram', 8655743922, 'wagonar', 89000)
do you want to continue(y/n):n
BIBLIOGRAPHY
● NCERT Text Book
● Computer Science by Sumita
Arora
● Python Programming Application