NOM = ""
Prenom = ""
Classe = ""
alpha=""

## Question 1
Q1_req = "SELECT CLI_NOM, CLI_PRENOM, TIT_CODE FROM T_CLIENT"

## Question 2
Q2_req = "SELECT COUNT(*) FROM T_CLIENT ;"
Q2_res = "100"

## Question 3
Q3_req = "SELECT CLI_NOM, CLI_PRENOM, TIT_CODE FROM T_CLIENT WHERE TIT_CODE='Mme.'"

## Question 4
Q4_req = "SELECT CLI_NOM, CLI_PRENOM, TIT_CODE FROM T_CLIENT WHERE TIT_CODE='Mme.' OR TIT_CODE='Melle.'"


## Question 5
Q5_req = "SELECT count(*) FROM T_CLIENT WHERE TIT_CODE='Mme.' OR TIT_CODE='Melle.'"
Q5_res = "17"

## Question 6
Q6_req = "SELECT CLI_NOM as noms, CLI_PRENOM as prenoms FROM T_CLIENT WHERE TIT_CODE='Mme.' OR TIT_CODE='Melle.' ORDER BY noms, prenoms"


## Question 7
Q7_req = "SELECT T_CLIENT.CLI_NOM, T_TELEPHONE.TEL_NUMERO FROM T_CLIENT JOIN T_TELEPHONE ON T_CLIENT.CLI_ID=T_TELEPHONE.CLI_ID"

## Question 8
Q8_req = "SELECT NOM FROM (SELECT CLI_NOM as Nom, CLI_PRENOM as prenom, COUNT(*) as nb_nom FROM T_CLIENT GROUP BY Nom) WHERE nb_nom>1"

## Question 9
Q9_req = "SELECT * FROM(SELECT CLI_NOM,COUNT(CLI_NOM) AS ct FROM T_CLIENT GROUP BY CLI_NOM ORDER BY CLI_NOM) WHERE ct>1"
Q9_res = "BENATTAR : 2, MARTIN : 3"

## Question 10
Q10_req = " SELECT AVG(LIF_REMISE_MONTANT),  AVG(LIF_REMISE_POURCENT) FROM T_LIGNE_FACTURE"
Q10_res = "Montant : 50, pourcent : 15"

## Question 11
Q11_req = " SELECT MAX(LIF_REMISE_MONTANT),  AVG(LIF_REMISE_POURCENT) FROM T_LIGNE_FACTURE"
Q11_res = "Montant : 50, pourcent : 15"

## Question 12
Q12_req = "SELECT FAC_ID FROM T_LIGNE_FACTURE WHERE LIF_REMISE_POURCENT>0 OR LIF_REMISE_MONTANT>0"


## Question 13
Q13_req = "SELECT DISTINCT CLI_ID FROM T_FACTURE JOIN (SELECT T_LIGNE_FACTURE.FAC_ID as facid1  FROM T_LIGNE_FACTURE WHERE LIF_REMISE_POURCENT>0 OR LIF_REMISE_MONTANT>0) ON facid1=T_FACTURE.FAC_ID"

## Question 14
Q14_req = "SELECT CLI_ID FROM T_CLIENT EXCEPT SELECT DISTINCT CLI_ID FROM T_FACTURE JOIN (SELECT T_LIGNE_FACTURE.FAC_ID as facid1  FROM T_LIGNE_FACTURE WHERE LIF_REMISE_POURCENT>0 OR LIF_REMISE_MONTANT>0) ON facid1=T_FACTURE.FAC_ID"


## Question 15
Q15_req = "SELECT T_CLIENT.CLI_NOM, T_CLIENT.CLI_PRENOM, max(montant_total) FROM T_CLIENT JOIN (SELECT CLI_ID as id_client, sum(montant) as montant_total FROM T_FACTURE JOIN (SELECT T_LIGNE_FACTURE.FAC_ID as facid1,  T_LIGNE_FACTURE.LIF_REMISE_MONTANT as montant FROM T_LIGNE_FACTURE WHERE LIF_REMISE_POURCENT>0 OR LIF_REMISE_MONTANT>0)ON facid1=T_FACTURE.FAC_ID GROUP BY CLI_ID) ON T_CLIENT.CLI_ID=id_client;"
Q15_res ="Medard,Jacques,600"
