Cours PL/SQL d’après cours ORACLE - OAI C. Bonnet / R. Chapuis PL / SQL.
Cours SQL Sh
-
Upload
youssef-don-rajawi -
Category
Documents
-
view
244 -
download
1
Transcript of Cours SQL Sh
-
7/25/2019 Cours SQL Sh
1/21
-
7/25/2019 Cours SQL Sh
2/21
QuestionID
Intitul
Rponse
NiveauDifficult
Thme
QUESTION
ClientID
Nom
Prnom
Adresse
DateNaissance
CLIENT
PassageCodeID
Date
Heure
LieuExamen
EXAMEN_CODE
NombreFautes
RESULTAT_SEANCE
NombreFautes
RESULTAT_EXAM
SEANCEID
DATE
HEURE
SEANCECODE
Numro
POSITION_QUESTION
CDROM
CdRomID
Editeur
NombreFautes
EST_AUTORISE
A PASSER
ASSISTE_A
NombreFautes
EST_COMPOSE_DE
CDROM
CdRomID
Editeur
QuestionID
Intitul
Rponse
NiveauDifficult
Thme
QUESTION
CONTIENT
Numro
SERIE
SrieID
ClientID
Nom
Prnom
Adresse
DateNaissance
CLIENT
PassageCodeID
Date
Heure
LieuExamen
EXAMEN_CODE
PENDANT
EST_DIFFUSE
SEANCEID
DATE
HEURE
SEANCECODE
MODELISATION UMLMODELISATION ENTITE ASSOCIATION
ASSISTE_A
EST_
AUTORISE_
A_
PASSER
*
CONTIENT
0:N 1:M
1:N
0:N
6:6
6
40
40:40
1:1
SERIE
SrieID
SrieID
DE
COMPOSE
EST
1:1
0:N
EST_
DIFFUSE_
PENDANT
1
*
0..8
0:8
*1..*
1
1..*
-
7/25/2019 Cours SQL Sh
3/21
5 14
40 : 40
1 : N
N om att1 attn N om att1 attn
-
7/25/2019 Cours SQL Sh
4/21
-
7/25/2019 Cours SQL Sh
5/21
Nom
Revue
ID
NbPages
Anne
Numro
comporte
Titre
Contenu
Article
fait rfrence
crit
Nom
Revue
Titre
Contenu
Article
Email
Prnom
Nom
ID
Auteur
ID
NbPages
Anne
Numro
Publication
PageDbut
PageFin
Modlisation Entit / Association
Priodicit
1:M1:N
1:M1:1
0:N
0:M
Auteur
EmailPrnom
ID
Nom
PageDbut
PageFin
1:N
1:N
Modlisation UML
Priodicit
1
crit
1..*
1..*1..*
1..* 1..*est publi dans
*
*
NumroID
rfrence
fait
comporte
est publidans
-
7/25/2019 Cours SQL Sh
6/21
RNom att1 attn RNom att1 attn
-
7/25/2019 Cours SQL Sh
7/21
-
7/25/2019 Cours SQL Sh
8/21
Personne(Livre=Recueil... (Emprunt))
{t.Personne| Emprunt(t) (u.Livre=
Recueil...
) }
Personne
t Emprunt Livre
-
7/25/2019 Cours SQL Sh
9/21
Personne(Emprunt) Personne(Retard)
{t.Personne | Emprunt(t) [ u Retard(u)(u.Personne= t.P ersonne) )]}
Personne t
Emprunt u
Retard Personne
t u
Personne,Livre(Emprunt) Livre(Emprunt)
Livre(Emprunt)
Personne,Livre(Emprunt)
Personne,Livre(Emprunt)
Livre(Emprunt)
-
7/25/2019 Cours SQL Sh
10/21
{t.Personne | Emprunt(t) [ u (Emprunt(u)) = ( v Emprunt(v) (v.Personne =
t.Personne) (u.Livre= v.Livre) )]}
Personne t
Emprunt
u Emprunt v Emprunt
v.Personne = t.Personne u.Livre= v.Livre
{t.Personne | Emprunt(t) [ u (Emprunt(u)) ( v Emprunt(v) (v.Personne =
t.Personne) (u.Livre= v.Livre) )]}
Personne
t Emprunt u
Emprunt
Emprunt
v Emprunt v.Personne = t.P ersonne
u.Livre= v.Livre
{t.Personne | Emprunt(t) [ u Emprunt(u) ( v Emprunt(v)(v.Personne= t.P ersonne)
(u.Livre= v.Livre) )]}
Personne,Livre(Emprunt) Personne(Emprunt)
Personne(Emprunt)
Personne,Livre(Emprunt)
Personne,Livre(Emprunt)
Personne(Emprunt)
{t.Livre | Emprunt(t) [ u (Emprunt(u)) = ( v Emprunt(v) (u.Livre= t.Livre)
(v.Personne= u.P ersonne) )]}
Livre t
Emprunt u
Emprunt v Emprunt
-
7/25/2019 Cours SQL Sh
11/21
u.Livre= t.Livre v.Personne= u.P ersonne
{t.Livre | Emprunt(t) [ u (Emprunt(u)) ( v Emprunt(v) (u.Livre= t.Livre)
(v.Personne= u.P ersonne) )]}
Livre
t Emprunt
u Emprunt u Emprunt
v Emprunt u.Livre = t.Livre
v.Personne = u.P ersonne
{t.Livre | Emprunt(t) [ u Emprunt(u) ( v Emprunt(v) (u.Livre = t.Livre)
(v.Personne= u.P ersonne) )]}
R1
R1= Personne[Personne,Livre,DateEmprunt(Emprunt) Personne,Livre,DateEmprunt(Retard)]
R1
Personne(Emprunt) R1
{t.Personne | Emprunt(t) [ u [Emprunt(u) (u.Personne = t.P ersonne)] = ( v
Retard(v) (v.Personne= u.P ersonne) (u.Livre= v.Livre) )]}
Personne t
Emprunt
u Emprunt u.P ersonne= t.P ersonne
v Retard v.Personne= u.P ersonne
u.Livre= v.Livre
{t.Personne | Emprunt(t) [ u [Emprunt(u) (u.Personne = t.Personne)] ( v
Retard(v) (v.Personne= u.P ersonne) (u.Livre= v.Livre) )]}
Personne t
Emprunt
u Emprunt u.P ersonne = t.P ersonne
-
7/25/2019 Cours SQL Sh
12/21
v Retard
v.Personne = u.P ersonne u.Livre= v.Livre
{t.Personne | Emprunt(t) [ u Emprunt(u)(u.Personne= t.personne) ( v Retard(v)
(v.Personne= u.P ersonne) (u.Livre= v.Livre) )]}
Date[Concert Chanteur=Corneille (Spectacle) Nom=Zenith(Salle)]
-
7/25/2019 Cours SQL Sh
13/21
Nom=Zenith (Salle)
{t.Date | Concert(t) [ u, v Spectacle(u) Salle(v) (u.Spectacle ID= t.Spectacle ID)
(u.Chanteur= Corneille) (v.Nom= Zenith) (u.Salle ID = v.Salle ID) ] }
Date t Concert u
t
v
u
Nom((Capacite>=CapaciteMax)Salle ID,CapacitMax[Salle(MAX(Capacite)CapaciteMax)(Salle))])
Salle ID,CapacitMax[Salle(MAX(Capacite)CapaciteMax)(Salle))]
{t.Nom| Salle(t) [ u Salle(u) (u.Capacite >=t.Capacite) ] }
t
-
7/25/2019 Cours SQL Sh
14/21
u
M AX
Chanteur(Spectacle)Chanteur [Spectacle (Nom=Cygale)(Salle)]
Chanteur[Spectacle (Nom=Cygale)(Salle)]
{t.Chanteur | Spectacle(t) [ u, v Spectacle(u) Salle(v) (v.Nom = Cygale)
(u.Chanteur= t.Chanteur) (u.Salle ID = v.Salle ID) ] }
t
u
v
u.Salle ID
-
7/25/2019 Cours SQL Sh
15/21
t
FROM
Chanteur,Salle ID (Spectacle Salle) Salle
ID(Salle)
Salle ID (Salle)
Chanteur,Salle ID (Spectacle Salle)
{t.Chanteur | Spectacle(t) [ u (Salle(u)) = ( v Spectacle(v) (v.Chanteur = t.Chanteur)
(u.Salle ID = v.Salle ID) ) ] }
t
u
v
v.Chanteur = t.Chanteur
u.Salle ID = v.Salle ID
{t.Chanteur | Spectacle(t) [ u (Salle(u)) ( v Spectacle(v) (v.Chanteur = t.Chanteur) (u.Salle ID = v.Salle ID) ) ] }
t
u u
v
v.Chanteur = t.Chanteur u.Salle ID = v.Salle ID
{t.Chanteur
|Spectacle
(t) [
u Salle(
u) (
v Spectacle(
v) (
v.Chanteur=
t.Chanteur) (u.Salle ID = v.Salle ID) ) ] }
-
7/25/2019 Cours SQL Sh
16/21
R1
R1= Billet ID(Billet) Billet ID(V ente)
R1 Billet ID(Billet)
Billet ID(V ente)
R2= Date,Concert ID (Concert Billet [Billet ID (Billet) Billet ID (V ente)]
R1
)
R2
Date,Concert ID (Concert)
R2
Date,Concert ID (Concert Billet [Billet
ID (Billet) Billet
ID (V ente)]
R1
)
{t.Concert ID, t.Date | Concert(t) [ u Billet(u) (u.Concert ID = t.Concert ID) (
v V ente(v) (v.Billet ID = u.Billet ID) ) ] }
t
u
u.Concert ID = t.Concert ID
v v.Billet ID = u.Billet ID
{t.Concert ID, t.Date | Concert(t) [ u Billet(u) (u.Concert ID = t.Concert ID)
( v V ente(v) (v.Billet ID = u.Billet ID) ) ] }
-
7/25/2019 Cours SQL Sh
17/21
FBureau= { NumBureau NumT elephone,T aille; NumT elephone NumBureau; }
FOccupant = { NumBureau PersonneID }
FMateriel={ NumPCNumBureau}
FBureau
NumBureau NumT elephone
FOccupant NumBureau
PersonneID
NumPC NumBureau
NumBureau NumPC
-
7/25/2019 Cours SQL Sh
18/21
FBureau= { NumBureau NumT elephone,T aille; NumTelephone NumBureau; }
Bureau NumBureau NumT elephone
NumBureau
N umTelephone
NumBureau Taille
[NumBureau]+ ={N umBureau, N umT elephone, T aille} NumBureau NumT elephone, T aille
[NumTelephone]+ ={N umT elephone,N umBureau, T aille} NumT elephone NumBureau
NumBureau Taille NumT elephone Taille
FOccupant = { NumBureau P ersonneID }
Occupant NumBureau
FMateriel= { NumPCNumBureau}
Materiel NumPC
R
R
R
R
-
7/25/2019 Cours SQL Sh
19/21
R
R
F ={
}
[AdresseEmail]+ ={
} = R
R AdresseEmail
R
R
-
7/25/2019 Cours SQL Sh
20/21
-
7/25/2019 Cours SQL Sh
21/21