0% found this document useful (0 votes)
3 views3 pages

Python Automobile Code Note Pad

The document outlines a Python script for an Automobile Management System that connects to a MySQL database. It allows users to manage customer details, service requests, and complaints through a menu-driven interface. The script includes functionality for inserting records into various tables based on user input for services like car wash, oil change, and mechanical issues.

Uploaded by

haniya.hyder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

Python Automobile Code Note Pad

The document outlines a Python script for an Automobile Management System that connects to a MySQL database. It allows users to manage customer details, service requests, and complaints through a menu-driven interface. The script includes functionality for inserting records into various tables based on user input for services like car wash, oil change, and mechanical issues.

Uploaded by

haniya.hyder
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

import mysql.

connector as sql
conn=sql.connect(host="localhost",user="root",passwd="netflixcancel00",database="au
tomobile_station")
if conn.is_connected():
print("succesfully connected")
print("-----------------------------------------------WELCOME TO AUTOMOBILE
MANAGEMENT SYSTEM-----------------------------------------")
c1=conn.cursor()
print ('table already exists')
c1=conn.cursor()
print("Automobile")
print("1. service station")
print("2. source")
print("3. selling")
print("4. customer complaints")
choice=int(input("Enter the Choice - "))

if choice==3:
v_sno=int(input("Enter the serial Number: "))
v_cname=input("Enter the customer name : ")
v_cdetails=input("Enter the customer details (unique identification number): ")
v_caddress=input("Enter the customer address: ")
v_cnumber=int(input("Enter the phone number: "))
v_cpuramt=int(input("Enter the principle amount: "))
v_cdisc=float(input("Enter the discount: "))
v_ccarname_model=input("enter details of car purchased;")
v_SQL_Insert = "insert into customer_details values({},'{}','{}','{}',{},{},
{}'{}')".format(v_sno,v_cname,v_cdetails,v_caddress,v_cnumber,v_cpuramt,v_cdisc,v_c
carname_model)
c1.execute(v_SQL_Insert)
print("CUSTOMER Created Congrats!!!")
conn.commit()

if choice==1:
print("A.car wash:")
print("B.oil change:")
print("C.mechanical issue:")
choice1=input("enter choice of service")
if choice1=="A":
s_sno=int(input("Enter the serial Number: "))
s_cname=input("Enter the customer name : ")
s_cdetails=input("Enter the customer details (unique identification
number): ")
s_caddress=input("Enter the customer address: ")
s_cnumber=int(input("Enter the phone number: "))
s_SQL_statement="insert into carwash values({},'{}','{}','{}',
{})".format(s_sno,s_cname,s_caddress,s_cname)
c1.execute(s_SQL_statement)
print("record created successfully")
print("please procede to station A1")
conn.commit()
if choice1=="B":
#c1.execute("select count(*) from oilchange")
o_sno=int(input("Enter the serial Number: "))
o_cname=input("Enter the customer name : ")
o_cdetails=input("Enter the customer details (unique identification
number): ")
o_caddress=input("Enter the customer address: ")
o_cnumber=int(input("Enter the phone number: "))
print("basic oil change charge:-------- 40 sr")
s_sql_statement="insert into oilchange values({},'{}','{}','{}',
{})".format(o_sno,o_cname,o_cdetails,o_caddress,o_cnumber)
c1.execute(s_sql_statment)
print("record created successfully")
print("procede to station A2")
conn.commit()
if choice1=="C":
m_sno=int(input("Enter the serial Number: "))
m_cname=input("Enter the customer name : ")
m_cdetails=input("Enter the customer details (unique identification
number): ")
m_caddress=input("Enter the customer address: ")
m_cnumber=int(input("Enter the phone number: "))
print("physical and diagnostic checkup fee:-------- 250 sr")
m_sql_satement="insert into mechanicalissue values({},'{}','{}','{}',
{})".format(m_sno,m_cname,m_cdetails,m_caddress,m_cnumber)
c1.execute(m_sql_statement)
print("record created successfully")
print("procede to station A3")
conn.commit()

if choice==2:
username=input('USERNAME:')
password=input('PASSWORD:')
c1.execute("select * from user where username = '' and passwd =
''".format(username , password))
data = c1.fetchall()
if any(data) :
import main
else:
print('''try again''')

if choice==4:
c_sno=int(input("Enter the serial Number: "))
c_cname=input("Enter the customer name : ")
c_cdetails=input("Enter the customer details (unique identification
number): ")
c_caddress=input("Enter the customer address: ")
c_cnumber=int(input("Enter the phone number: "))
c_complaint=input("enter complaint of customer")
c_SQL_statement="insert into customercomplaints values({},'{}','{}','{}',
{},'{}')".format(c_sno,c_cname,c_cdetails,c_caddress,c_cnumber,c_complaint)
c1.execute(c_SQL_statement)
conn.commit()
print("record created successfully")

#Creation

'''import mysql.connector as sql


conn=sql.connect(host='localhost',user='root',passwd='manager',database='AUTO_MOBIL
E_SURVICE_STATION')
if conn.is_connected():
print("Successfully Connected")
c1=conn.cursor()
c1.execute('create table customer_details((sno int primary key, cname
varchar(25),cdetails varchar(30),caddress varchar(30),cpincode int,cpuramt
int,cdisc float)')

print ('table created')'''

You might also like