Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
REGION:VARANASI
DBMS : MYSQL
USER : ROOT
PASSWORD: “a”
DATABASE: pms
IMAGES OF TABLES:
Python Code:
'''
import os
import platform
import mysql.connector
mydb=mysql.connector.connect(host="localhost",user="root",password="a",database="pms")
mycursor=mydb.cursor()
def Add_Record():
L=[]
id1=int(input("Enter the parking number : "))
L.append(pid1)
L.append(pname1)
L.append(level1)
L.append(freespace1)
L.append(vehicleno1)
L.append(nod1)
L.append(payment1)
stud=(L)
mycursor.execute(sql,stud)
mydb.commit()
def RecView():
print("4. All")
if ch==1:
rl=(s,)
sql="select * from parkmaster11 where pid1=%s"
mycursor.execute(sql,rl)
elif ch==2:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==3:
rl=(s,)
mycursor.execute(sql,rl)
elif ch==5:
mycursor.execute(sql)
res=mycursor.fetchall()
for x in res:
print(x)
def Vehicle_Detail():
L=[]
L.append(vid1)
L.append(vnm1)
L.append(dateofpur1)
vdt=(L)
sql="insert into vehicle (vid1,vnm1,dateofpur1) values (%s,%s,%s)"
mycursor.execute(sql,vdt)
mydb.commit()
def Vehicle_View():
vid=int(input("Enter the vehicle number of the vehicle whose details is to be viewed : "))
rl=(vid,)
mycursor.execute(sql,rl)
res=mycursor.fetchall()
for x in res:
print(x)
def remove():
rl=(roll,)
mycursor.execute(sql,rl)
mydb.commit()
def Menu():
if(input_dt== 1):
Add_Record()
elif (input_dt==2):
RecView()
elif (input_dt==3):
Vehicle_Detail()
elif (input_dt==4):
remove()
elif (input_dt==5):
Vehicle_View()
else:
Menu()
def runAgain():
while(runAgn.lower() == 'y'):
if(platform.system() == "Windows"):
print(os.system('cls'))
else:
print(os.system('clear'))
MenuSet()
runAgain()
OUTPUT: