Commit f8a6cf68 authored by Louis Lechevalier's avatar Louis Lechevalier
Browse files

Update Rendu 4/fonction.py

parent 6c5d9339
......@@ -564,4 +564,41 @@ def nombrePlacesLibres(conn):
#Choix du type de vehicule
typeV = input("Quel type de place vous intéresse: 2 roues / camion / vehicule simple")
def nombreDeuxRouesEnregistres(conn):
cur = conn.cursor()
try:
sql = "SELECT COUNT(*) FROM vehicule WHERE type= '2 roues'"
cur.execute(sql)
raw = cur.fetchone()
print("Nombre de 2 roues : ",raw[0])
except Exception as e:
print(f"Message systeme: {e}")
print("Retour au menu")
def nombreCamionsEnregistres(conn):
cur = conn.cursor()
try:
sql = "SELECT COUNT(*) FROM vehicule WHERE type= 'camion'"
cur.execute(sql)
raw = cur.fetchone()
print("Nombre de camions : ",raw[0])
except Exception as e:
print(f"Message systeme: {e}")
print("Retour au menu")
def nombreVSEnregistres(conn):
cur = conn.cursor()
try:
sql = "SELECT COUNT(*) FROM vehicule WHERE type= 'vehicule simple'"
cur.execute(sql)
raw = cur.fetchone()
print("Nombre de vehicules simples : ",raw[0])
except Exception as e:
print(f"Message systeme: {e}")
print("Retour au menu")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment