Vous êtes sur la page 1sur 8

'#

& ! ( ) *) + , -. /
0) ) ' & 1' " 2

3 4 56786987669

! ! " !
! " !
! !#
## $!%

! " !
$ & $!%

!
" #
$
%

&
'

( CONS TRAI NT )
* )
CREA TE TABL E ALTE R TABL E
' ALTE R TABL E !

& CONS TRAI NT


! '

' +

,- ./01 . 2 /1
"0/34%35( 1
6(%5 -. (&&5
/%7%/% ,% 89 8 :
;:
8- ( *0.%,0 ,0*%5 %. (&&:
8- *%&%.%,0 ,0*%5 %. (&&:
<
% ' +

,/%0.%.0=&%7 9
17 1 .%>%/ ,- ./01 ., /1
"0/34%3;

' +

,- ./01 .
2 /1"0/34%39 8 8 ::;5
( 16(%9 8 8 ::
;5
7-/%1> 4%38 - 1 *%?:9 8 8 :
:; /%7%/% ,% 8
9 8 8 :
:;:
8- ( *0.%,0 ,0*%5 %. (&&:
8- *%&%.%,0 ,0*%5 %. (&&:<

0 +

0&.%/ .0=&%, 0** ,- ./01 ., 7 ( 1


6(%9 ,1
7;

%
% )

% )
'
@ % ! )

% !

%
)
!

CONS TRAI NT+

UNIQ UE+ ' %


! '
'
'

PRIM ARY KEY+


. ' ,
'
! PRIM ARY KEY

FORE IGN KEY+ !


!
'
! !

!
" # !

$ !" "
6&+
0&.%/ .0=&%7 0** ,- ./01 ., A7 7-/%1
> 4%39 , ; /%7%/% ,% , 9
1, ;

0 FORE IGN KEY !"


# ! "
# !

0 )

(
' (
'

>
! 9
; ( ! " #
! !

&
' ( NULL 9 ;
' & !

& )
( !
9! ;
1 !
" ! # 9
! ; )
$ % ' )

! ! : ;

9
. ; 9
. ! ;

17

$ % #

&
' (

, ) CONS TRAI NT
0 )
$ *
$ !
9 ! ;
) )
)
%! & * * 6&
" # +

0 CREA TE T ABLE
, ALTE R TA BLE
, CREA TE I NDEX

, ! "
CREA TE TABL E ALTE R TABL E $ ! !
CONS TRAI NT %
CREA TE INDE X !

CREA TE TABL E )
ALTE R TABL E CREA TE INDE X

B ) " 0
" #

! ! " !

! CONS TRAI NT;


9
CREA TE TABL E

( ! ' CONS TRAI NT


CREA TE TABL E

% ' +

,/%0.%.0=&%, 9
1, 1 .%>%/ ,- ./01 .,1 /1
"0/34%3
.%?.9 CD; E1
.B ,-" -. (&&;

0 +

,/%0.%.0=&%, 9
.%?.9 CD; E1.B ,-"
1, 1 .%>%/<
,- ./01 .1 , ( 1
6(%9 1, ;;

& ! '
CONS TRAI NT !
) CREA TE TABL E

! " !

! $ CONS TRAI NT ALTE R TABL E


! +
0&.%/ .0=&% 0** ,- ./01 .
2 /1"0/34%39 8 8 ::;5
( 16(%9 8 8 : :
;5
7-/%1> 4%39 8 8 ::; /%7%/% ,% 8
9 8 8 :
:;:
<

% ! +

0&.%/ .0=&%% 0** ,- ./01 ., /1


"0/34%39
1% ;

0 ' ' ! +

0&.%/ .0=&%0 0** ,- ./01 . , ( 1


6(%9 0 ;

' 7 9 ; 0 9 ! ;+

0&.%/ .0=&%0
0** ,- ./01 . 0
7-/%1 > 4%39 7 ; /%7%/% ,% 7 9
17 ;
- ( *0.%,0 ,0*%
- *%&%.%,0 ,0*%

! !#
## $!%

( ! !+

,/%0.%8( 1 6(%:1 *%?


- 9 80 ,5*% ,:
8 80 ,5
*% ,: : ;
8E1.B 2 /1"0/35*1 0&&-E (&&51
> -/% (&&<:

%
E1
.B +

/1
"0/3

*1 0&&-E (&&

1
> -/% (&& !

& 9
E1.B /1
"0/3 *1 0&&-E (&&1
> -/% (&&;
/1
"0/3 ( 16(% *1 0&&-E (&&
' % *1 0&&-E (&& 1
> -/%
(&& +

= ! ; $ > ; !

. 7 F (&& G $
7 7 F (&& G $
. 7 . F (&& G $
E1
.B

% 1, +

,/%0.%1 *%? " A1 - , 9


1, ;

0 $ E1
.B $ '
1, +

,/%0.%( 1
6(%1 *%? " A1 - , 9
1, ; E1
.B *1 0&&-E (&&

( '
! 6& " #
!
+

,
* !

) ALTE R TA BLE

! " !

ALTE R TA BLE !+

0&.%/ .0=&% ) */- ,- ./01 . *

! 7 )
9 ; # +
+

H% !
0&.%/ .0=&%0 */- ,- ./01 . 0

H%
0&.%/ .0=&%, */- ,- ./01 .,

! $ & $!%

/ ! DROP
INDE X ! +
*/- 1 *%? * - )

0 +

0&.%/ .0=&%0 */- ,- ./01 . ,

% 0*- %. ! " 0
6& ! " 9
; + 9 ! ; ) & ! 6&
! 9
0*-; $ 9
*0-;+

1 * - *

* 0 I- * ,
* 0 I- * ,
* 6&0

.
H, !
E )
, JA
K J" # -&%*= LDGKM A
K
* J,+N
" N
=O K
- 9
;
% E )

, ) !0 %!
" = ! ) I9 !" A
K% ! KA
" = != -4 " = !1 %! ;
%!

% .

H, 6&
6&J K
0&.%/ .0=&%0 */- ,- ./01 .7 0 K

.
H, ,
E )
, J
, . ! J 6&
, . J, . .!
%! 6 9;
% E )

" = ! ) I9 K ) KA
K
0&.%/ .0=&%K " = != -4 A
" = !1 1 ;

, ) !0 %!
" = ! ) I9 !" A
K
% KA
" = != -4 " = !1 %! ;

% .

H, 6&
6&J K
0&.%/ .0=&%0 */- ,- ./01 ., K

.
H%
, . ! J 6&
%! 6 9;

" = ! ) I9 K ) 0 KA
K
0&.%/ .0=&%K " = != -4 A
" = !1 1 ;
, ) !0 %!
" = ! ) I9 !" A
K
% KA
" = != -4 " = !1 %! ;

% .

H, 6&
6&J K
*/- 1 *%? , - 70,.(/0 K

.
H%
, . ! J 6&
%! 6 9;

" = ! ) I9K ) 7 KA
K
*/- 1 *%?K " = != -4 A
" = !1 1 ;

, ) !0 %!
" = ! ) I9 !" A
K
% KA
" = != -4 " = !1 %! ;

% .

H, ! , 9
;

- +

' ?
# < <
- $ %66@5 $ %
- $ %6AA5 $ %
- $ %6A75 $ %

! ( ) *) + 1 7669

+ & )
! B ) (
!

.) I ) I ) 3 P