Portfolio de Mongi Rafraf

Plan

serie 2 Commenter cette section

exercice n 1:

create table S (s# varchar (3) primary key, statut number(5),ville varchar(10));

create table P (p# varchar (3) primary key, pnom varchar2 (10),couleur varchar2(10),poids number (5),ville varchar(10));

create table J (j# varchar (3) primary key, jnom varchar 2(10),ville varchar(10));

create table SPJ (s# varchar (3) ,p# varchar (3) ,j# varchar (3));

exercice n 2:

1/ select * from p;

2/ select * from p where ville = 'London';

3/ select s# from s.spj.j where s.s# = spj.s#; and j# = j1; order by s#;

4/ select p# from p.spj where qty between 300 and 700 and p.p#=spj.p#;

5/select distinct couleur,ville from p;

6/ select s#,p#,j# from spj where s.ville=p.ville and p.ville = j.ville;

7/select s#,p#,j# from s,p,j where s.ville <> p.ville and p.ville <> j.ville;

8/select p# from p,s,spj where s.ville = 'Londre'

and s.s# = spj.s# and p.p# = spj.p#;

9/ select s#,p#,j# from s,p,j,spj where s.ville<> p.ville and p.ville <> j.ville;

10/ select s# from s,p,j,spj where (s.ville,p.ville,j.ville ) = 'London'and s.s# = spj.s# and p.p# = spj.p# and j.j# = spj.j#;

11/ select ville1,ville2 from s,p,spj where s.s# = spj.s# and p.p# = spj.p#;

12/ select cuont (s#) from s;

13/ select count (s#) from s,p,spj where s.s# = spj.s# and p.p# = spj.p#;

14/ select count (p#) from spj where spj.p# = p2;

15/ select sum (qty) from spj where spj.p# = p2;