Commit bb18f71e authored by Lingfeng Huang's avatar Lingfeng Huang

Update prog.py

parent 4d3a2b05
......@@ -386,15 +386,17 @@ def afficherStatistique(conn):
sql="SELECT P.medicament, SUM(P.quantite) FROM Traitements T, Prescriptions P WHERE T.animal = "+str(id)+ "AND P.traitement = T.id GROUP BY P.medicament"
elif(choix==3):
nomMolecule=input("Entrez nom de molecule: ");
sql="SELECT SUM(P.quantite) AS quantite_prescrite FROM Prescriptions P WHERE P.medicament = \""+nomMolecule+"\""
sql="SELECT SUM(P.quantite) AS quantite_prescrite FROM Prescriptions P WHERE P.medicament = \'"+nomMolecule+"\'"
elif(choix==4):
sql="SELECT M.nomMolecule, SUM(P.quantite) AS quantite_prescrite FROM Prescriptions P, Medicaments M WHERE P.medicament = M.nomMolecule GROUP BY M.nomMolecule;"
elif(choix==5):
sql="SELECT A.espece, AVG(A.derniereTaille) AS taille_moyenne FROM animaux A GROUP BY A.espece"
if sql:
afficherSql(conn,sql)
if choix>5 or choix<1:
return
if sql:
afficherSql(conn,sql)
sql=""
def afficherTable(conn):
while True:
......
Markdown is supported
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