0% found this document useful (0 votes)
204 views12 pages

Database Queries & Modifications

Uploaded by

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

Database Queries & Modifications

Uploaded by

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

o t o m

e c o
r o n d

o n n u t
u n i u e
p o t
v
v
v

f
f
v
f
v
f

f
v
f

1 3 2 1
R7

R6

leçon ( idlec , desclec , lien lec , idmat# )


matiere ( idmat , libmat )

appartenant ( idapp , nomprenapp , mailapp , idetab#)


etablissement ( idetab , libetab , govetab )
alter table medicament add datefin date check (datefin > datefab);

alter table medicament modify caracmed varchar(150);


select codeplante , nomplante , descplante
from plante
order by(nomplante)desc;

select nommed, caracmed from forme f, medicament m


where f.codeforme=m.codeforme and nomforme='Sirop';

select codeplante, nomplante, descplante


from plante p, composition c
where p.codeplante=c.codeplante
and codemed='Med001';

select codemed, nommed ,caracmed


from traitement tr,medicamedt me,maladie ma
where tr.codemed=me.codemed
and tr.codemaladie=ma.codemaladie
and nommaladie='Fièvre';
select * from medicament
where year(datefab)=year(now());

select avg(duree)
from traitement
where codemaladie='TSE005';

select codemed,nommed
from medicament me,traitement tr
where me.codemed=tr.codemed
and codemaladie='TSE005' and duree=
(select min(duree)from traitement
where codemaladie='TSE005');

select m.codemed,nommed,count(codeplante) nb
from medicament m,composition c
where m.codemed=c.codemed
group by(m.codemed)
having nb>=2;
insert into forme values('IF0005','Inhalation');

update composition
set dose=dose*2
where codemed='MED001' and codeplante='BS0001';

You might also like