0% found this document useful (0 votes)
11 views2 pages

SELECT Matiere

Uploaded by

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

SELECT Matiere

Uploaded by

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

SELECT matiere,

CASE

WHEN matiere LIKE '%Geo%' THEN note*2

WHEN matiere LIKE 'Math%' THEN note*3

ELSE note

END AS coef

FROM tp_examens;

SELECT id_etudiant,

CASE

WHEN AVG(note) < 10 THEN 'Faible'

WHEN AVG(note) >= 10 AND AVG(note) < 15 THEN 'Bien'

WHEN AVG(note) >= 15 AND AVG(note) < 18 THEN 'TB'

ELSE 'Excellent'

END AS Resultat,

AVG(note) AS Moyenne

FROM tp_examens

GROUP BY id_etudiant;
SELECT id_etudiant,

CASE

WHEN COUNT(*) = 1 THEN 'Cursus en cours'

WHEN COUNT(*) = 2 THEN 'Cursus fini'

END AS Cursus

FROM tp_examens

GROUP BY id_etudiant;

SELECT tp_examens.matiere,

tp_examens.note,

tp_etudiants.prenom,

tp_etudiants.nom

FROM tp_examens

INNER JOIN tp_etudiants

ON tp_examens.id_etudiant = tp_etudiants.id_etudiant;

You might also like