Académique Documents
Professionnel Documents
Culture Documents
Gestion etablissement
par
Salma fakhre-eddine
houda mansouri
Créer une base de données
create table etudiant (nom varchar(25),cne varchar(8), PRIMARY key (cne),idf varchar(8),FOREIGN
key(idf) references filiere(idf));
create table salle (nums varchar(4),capacity int, idc varchar(6),primary key(nums),foreign key(idc)
references cours(idc));
2
Saisir les données
3
4
5
Les requêtes
6
2) SELECT nom,note,idc,note.cne from etudiant,note where idc="DAO" and note>11 and
etudiant.cne=note.cne
7
3)SELECT nom,note,idc,note.cne from etudiant,note where idc="DAO" and note>11 and
etudiant.cne=note.cne ORDER by note
8
4)select * from salle where capacity>40
9
5)select nom,note.cne,avg(note)from note,etudiant where nom in (select nom from etudiant where
cne=1024)and etudiant.cne=note.cne
10
6)select COUNT(nom) from enseignant,filiere where idf="TH"
11
7)select nom from enseignant,filiere where echelle="chercheur" and idf="TH"
12
8)select nom,AVG(note),note.cne,idf from note,etudiant where idf="LI" and etudiant.cne=note.cne
GROUP by cne
13
9)select N1.cne , N1.note , N2.cne,N2.note from note N1 , note N2 where N1.note=N2.note and
N1.cne>N2.cne
14
11)select nom from etudiant where nom in ( select nom from etudiant where idf="TH") and nom not
in ( select nom from etudiant where idf="LI")
15
12)select C1.capacity , C2.capacity , C1.nums , C2.nums from salle C1 , salle C2 where
C1.capacity>C2.capacity and C1.nums>c2.nums ORDER BY C1.capacity
16
17