You are on page 1of 1

**************************

select ref(p)
from personne p;

select p.nume,p.nom,p.prenom, treat(p.adresse as


adresseWitbEmail_type).adresseEmail
from personne p
where p.adresse is of(adresseWitbEmail_type);

select p.nume,p.nom,p.prenom, treat(value(p) as enseignant_type).grade


from personne p
where value(p) is of(enseignant_type);

select p.nume,p.nom, treat(value(p) as etudiant_type).numCarte,treat(value(p) as


etudiant_type).anneeinscription
from personne p
where value(p) is of(etudiant_type);
select *
from personne p
where value(p) is of(only personne_type);

create table bureau(numb number(8),etage number(10),occupant ref personne_type,


constraint pk_tt primary key (numb));

insert into bureau values(122,1,null);


insert into bureau values(230,2,null);

update bureau b
set b.occupant=(select ref (p) from personne p where p.nume='100')
where b.numb=122;

SELECT *
FROM bureau b
where b.occupant is not null;

You might also like