SQL Server 2000 - Vietnam
SQL Server 2000 - Vietnam
SQL Server 2000 - Vietnam
! " ! #! !$! %! !
& #'% ( ( ) * +, !" +- ! . " /
" / 0% #'% $!" 1 ! !$! 2 ! !$! 3 4 * 5 +,
3 $ / 6 7 3 ! " #'% 0
:M " N
n ] 4 ! $; e 0 ! 7 ! L" $; :
, ! < W !& C $; Z 0
n ] $; e 0
n ] ( ) @ e )* ) 0 8 ] : , 5
C + $ " 6 &( @ a gD o : , 5 C + $ " 6 < P! :0 D "
[email protected] Page 1 of 44
K" " 8> ! 8> 5 a "` W ! " ] + ! " !" m "
8> ; " 8> ) * 0 g p! 7 $; +89 ?/ 6 ! ! ( 7C
" " ! ] $; : &_ & 6/ ! ! !( " 0D & < ! < e %L
%" +, m " e 6/0
% + , +Q $ +3 8 " ) 0 g: " m , $; :
, ! " @ 3 " 8@ 7 = O / ! F 0 g p! $; : ,
;& " " " T0j "Q M0 @ " < 5 3& + _ &7 = ,L & ! @
3 " 8@ +Y&(0 i +: " o < 3& $; s " @ [!
! f + 0
[email protected] Page 2 of 44
1.3.1. Relational Database Engine E .3 t P! N
dY& :7 H 4! ! ! 3 & =7 3 ! 8@ ; !$
//" ? 3 7 , 7C !! " " ( = * P! % " "I 8W k #! !
u$v W#u(2 u B #'2 ! u/ #! !$! ." & u#'.(0 g " ! : s : 7 H w
+_ h /( Z * 8 ) * < 3 &< " ( P! 3& 7 O ;
&< " +_ 7 " "II0
# #! !( 4! " ! !$! f ~ : p! ] _ C 8 $; 7 = ,
?& +89 = J I" ! " ( $- Z [ +:0 #" +: % " "I ?/ " $; =
* ? ; F/ " / Y Z < m $q 3 5 7 3
] 7 _ _ E " $ ( 7{ 6 G+ " \ G !! ( f +89
F = @ " $ |R0
[email protected] Page 3 of 44
. " 5 $; : +e 3 3 7 3 ! ;& _ ] $; o f ?& $""7
" & ? * 7 = , C +89 " < % " "I @ " / : +Z 7• "
(0
[email protected] Page 4 of 44
Bài 2: Gi i Thi u S L c V Transact SQL (T-SQL)
D! ! E = w! < l P! J u J ! " ! u ! z! "
I" ! ! z! " ( Wg J W ! g! " ! ! ! J ( +89 ) * " 7 3
@ KE K" !E ( 5 " u! 0
• . ! "$v ‚g!
• W "$v ‚g!
• # "/ "$v ‚g!
AZ *N
USE Northwind
USE Northwind
USE Northwind
• V!
• "7
• # &
[email protected] Page 5 of 44
AZ *N
USE Northwind
GRANT SELECT
ON Customers
TO PUBLIC
USE Northwind
DENY SELECT
ON Customers
TO PUBLIC
USE Northwind
REVOKE SELECT
ON Customers
TO PUBLIC
dY& / - $C 5 +, L) !! 8 2 S/ ! 2 J 2#
AZ *N
USE Northwind
SELECT CustomerID, CompanyName, ContactName
FROM Customers
WHERE (CustomerID = 'alfki' OR CustomerID = 'anatr')
ORDER BY ContactName
USE Northwind
INSERT INTO Territories
VALUES (98101, 'Seattle', 2)
USE Northwind
UPDATE Territories
SET TerritoryDescription = 'Downtown Seattle'
WHERE TerritoryID = 98101
USE Northwind
DELETE FROM Territories
[email protected] Page 6 of 44
WHERE TerritoryID = 98101
d, ;& 3 Y Z * < $; O ) * @ /( /
; $ 4 D
dY& Z <
P! 3 ! !$! "$v 0 g: 5 +, L3 +X "$v 0 . F 7 : +C u$v "
F ! +_ 6/ +C !$ 2 `2 " /" 2 L00000A] O 8 e 4 "
+_ +89 C 7C " 7 , 8@ + 89 "$v E" ((0 D " Z * ! D!$ k2
i &." 2 # / " I
.: !
"; J I "; = 8> 8 ( "; e
2 "; & O : ? GG !& ? †‡ +, H 3 0 "; # +89 5 + @ 3 5
@ [ 7 :! P! 7 &`" ( !& 3 :7 " 0
[email protected] Page 7 of 44
AZ *N
E F- 7 ,
AZ *N
USE Northwind
DECLARE @EmpIDVar INT
SET @EmpIDVar = 3
SELECT * FROM Employees
WHERE EmployeeID = @EmpIDVar + 1
G FH3 ,
.3 - +89 ! R : N
/ F = J K ,
$ 3 L . G I
g 8 'BVJg000Bg#2 ' BWi2 .ugDJgSB2 VuDu2 J…000B B2 BDS g2 aŠJ B0000 k L < '""7 u +,
$C < _ 3 / O &0
[email protected] Page 8 of 44
F ; ? ,
D w D .3 .Y
M N B K 'O D
% Y +89 / Y ! 3 / O F / 3/ 8 < $ /! 2 ! +:
u/ z $ / 6 ! e P! ( f/ Y Z ] 3 w BL K! ( 8
? Z * 8 3 " ! Z &< P! 3& ? 000 ! +: B f w
_ 7C 0
M N P K F- ,
i w : f/ Y Z ] $ / 3/ 8 " 3 Y 8 Y
+ 4! L " / ! +r +89 $ < X " / ( " $ @ ! +: C : <
+89 e ; O ! ] 7 = O $< X : , w !& + _ & F/ "
$! ;& ! 0
K Q.
[email protected] Page 9 of 44
Bài t p 2 SQL Server 2000
Manipulate Data and Stored Procedure
#B. W B ˆ! ‚ ! ! ! U (2 ˆ! ‚I ! ! ! (
#B. W B B / "& ‚. " .S u …u
. BWDB K u.B#S B W g `u
ˆu J# ! 2
ˆK " g! ! ! j (2
ˆ. " g! ! ! j (2
ˆ ! •| u /
W
#B. W B ˆ. " J# !
'BVJg D Wg W.DJug
JI " BL B B.D . " J# … u% . " aŠB B †g! ‡•ˆ. " g! (
'BVJg
BD ˆ. " J#• B B.D %!L . " J#( … u% . " (
BD ˆ. " J#•ˆ. " J#Œ|
Jg B D JgDu . " AW SB ˆ. " J#2ˆ. " g! (
JI BL B B.D u J# … u% †u ‡ aŠB B u J#•ˆu J#(
'BVJg
B B.D ˆ •|
u 'W.i D Wg W.DJug
Bg#
B
'BVJg
Jg B D JgDu †u ‡u J#2K " g! 2. " J#(
AW SB ˆu J#2ˆK " g! 2ˆ. " J#(
B B.D ˆ •
.u%%JD D Wg W.DJug
[email protected] Page 10 of 44
Bg#
Bg#
B
'BVJg
JI BL B B.D u J# … u% †u ‡ aŠB B u J#•ˆu J#(
'BVJg
B B.D ˆ •|
u 'W.i D Wg W.DJug
Bg#
B
'BVJg
Jg B D JgDu †u ‡u J#2K " g! 2. " J#(
AW SB ˆu J#2ˆK " g! 2ˆ. " J#(
B B.D ˆ •
.u%%JD D Wg W.DJug
Bg#
Bg#
K ˆ
[email protected] Page 11 of 44
Bài 3: Design and Implement a SQL Server Database
3.1. C u Trúc C a SQL Server
g 8 +r ] $ & 3 $ 8@ " +Q + , P! )
< 7 : +C ( " +: ! : +C J ! P! 2 =
8> +: # I! J ! 0% J ! P! :U & ! !$! !& _
! !$! 0 .3 & ! !$! $!" 1 N
[email protected] Page 12 of 44
D 8@ 7 8 !! " !$ : O / < 7 " "
!!I " !$ +:0 g 7 " +: Z 3 L 0 .: "; BL N)* * ";
“ 9/( 5 +, 4! ! ! P! _ !$ " 5 BL 9 * "; O ?(
5 +, 4! ! ! P! !$ 0 dO < 3 K! " % L BL +, 4! ! ! "
!$ ! +: 7 !! H 8 ] ~ S I" BL " !$ +:0
[email protected] Page 13 of 44
g " . 7 K" K" &E/! s +89 +8! " p! $ 0/ I 0 dY&
! Y O h 4 ? ƒ !/ O !! ! " 7• ? +X !
+: ; P &< > O ƒ @0
. F ! &, _ ”j [! " W !
! " ' 8 6& = & O 3 $8@ ! N
|0 D [ ”j [! " W
0 . ”j "! " '
[email protected] Page 14 of 44
D" ] f < 2 ! ! " +89 $ , m $q o < 0D* q ! * >
! 0V ) . 7 K" +89 +3 ? " > +, ! ! ! " R 8 ] f ! +:
w Lr& ! 8@ 7 Q/ . 7 /" 7C C/0 g 8 6& 7 +89 ! : f w! <
] " ! ! " " I +, / * 1 ! ! L ] f(0
d _ +: : p! f7 = O ] + @ ! ! " | ] ; > +, . 7
/" ! ! +r +89 8 " p! 1 0 D " 7 +: ! ! " U f +89 " I" `! ] & +r +89
" 8 " w L & ! 8@ > +, 7 /" 7C C/ < ! ! 8! 7X/ 8 " p!0 D4
w! < = +89 < " I " " : +O& +P +, C " p! 4 0
.s ! ! " R j ] 8! +89 " " $X "` $? >( " < f " $! 7 !
! ! " & w! < ] +89 < " I 0
[email protected] Page 15 of 44
& " K" • *
‹ / ! ! ‹‡ "$v " +:
/‚` " †‹ " ‹‡ . " $C = _
AZ *N
! $‚ z "` $ ! ! 00000
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEE
EEEE
g" ` R0bU %' ! T W T ! •ug JgB2 S/ ! !$ &• BW#‚a JDB2 00000
" /" /‚ /! 8 Z * !
S B g" `
V"
/‚ /! ‹. " ‹
f " $C = _ !$ . " N
! "` !! L‚ z
EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
. " b| | U i' U i' c i' i'
[email protected] Page 16 of 44
! +: F ! h +3 < P! ! !$! 7 ui0
AZ *N
S B !
Vu
. BWDB #WDW'W B K "
ug
gW%B • / " ‚ ! 2
…J BgW%B • ‹ N•/ " ! I • " "I • • ! !•/ " 0 I‹2
J–B • U2
%Wk J–B • | 2
…J BV uaDŠ • |
(
Vu
: VD
[email protected] Page 17 of 44
i ;" ! ! !$! F ! o / 8 +, ! Nd @ 3 \ +:
? +_ + P! 7 = "; ;& ] F ! 8> e 3 3 X Q +X I! (
" 0 2( / I 0g 8 < /" " P! 3 @
7Z 8@ P! ! !$! / +89 8> #'W 8@ 89 8@ 5& " O — P! $ 2 =
8> 8> ! 7 = e W " "` w + H 8 ( W " 7 w+ ƒ (0 .Y \ +89
+Q ! +Y& ] !" ! 7 = +, e 3 X7 +O " ! !I ! +: 7 O ] :
f w+ @ ! ; / 8@ 89 8@ y g &< Y C e W " "` !& W " 7(
] F ! : , f Q/ ? +_ ! N
• D˜ 8 +3 7, +C 7 H P! 0 #" : / 8>
L &< 7 , !L : +P 7 " O C !& 7 = C 7 = +P : f /
$q 3 < 7 " [ p! 4 Z 3 ] & f 6 + "; +
P! 0
• NA < o f " !!7 = +89 < * 4!
_ 7 3 ! " p! 4 +_ & o Y& 8 < + P!
0
D 8@ C $; / } _ 3 "; / 0 AZ * $; / $C t w 7 3 $ !
FWX,2 FWX, FWX,2 FWX,0 "; . ! "; : 7Z 8@
+X p! " Z * < C ! ! +8! " GD ! ! & " !! G @ | 7 w( ]
f w+ } / O + = ! h s GD !G0 D8 w C +8! " \ | ]
f < 7 " " / Z! ! " +P | 7 w0 g 89 ; "; ! ! f 7 = < 3 7 "
/ Z! ! 7 +8! " Z | 0 .s "; ! ! $} +O $q 4! ; " 0
% 8 7 3 " ! : 3 "; J 8N / 2 2 2 0
D" +: 7Z 8@ [ "; 8 4 |2 2U2c $& 0 g p! "; 8 +8 @
"; 8 +8 @ " A'0
i C 7C !$ < N
• .: Z ? "; 5 +, L3 +X " m 0
• . h 4! ! ! P! & w ,(
[email protected] Page 18 of 44
| J % " "I K .W ' 7 & S W
a "` g ` %W '" " S W
' A ! '!
R a "L .W ' 7 & S W
T0
D! < 3 ! !$ '""7 !$ K $ 8 ! N
'""7J# D K $ J#
| J K|
a "` K
R ' A ! '! T0 KR
• D3 5 : 4! +9 < = : 3 X " 3
• D3 6/ ; 3 X !& " +:
AZ * 3 : , +89 C $ 3 8 C ! : , 5 "
3 ! +, 4! ! !N
'""7J# D W "
| J š" ' "`
a "` %! ` '" 7 2 7 š" "
K a 2 š! %"" 2 š"
R ' A ! '! T0
' "`
!&
[email protected] Page 19 of 44
D & < 6/ + 6/ ; W " f ;" _ ? +_ ! &0 . ~ ; 8 C 3
: _ R 3 ] F ! f Q/ / _ / 4 !&0000D " Z * & ! < Q ! R !$
8 ! N
'""7J# D
| J
a "`
R ' A ! '! T0
W J# … g! ! g!
W| š" ' "`
W %! ` '" 7
WR 7 š" "
WU K a
Wj š! %""
( -
'""7J# W J#
| W|
W
WR
R WU
R Wj
R W|
g " ! " +_ ! e / $C t ! 8 ( ! 3 !$ N
[email protected] Page 20 of 44
Bài 4: Backup And Restore SQL Server
4.1. Chi n L c Ph c H i D Li u (Data Restoration Strategy)
.3 ; $C !& ! e! : ,L & ! N
d, : , , 3 7, / * 1 7 3 ! $; / $C ! 3 "; $! 7 / "
[email protected] Page 21 of 44
• - 8 / ) N n " & 3 "; + ! Z "; 8 ' 7
J 2 $ /2 . ! J L2 a D L 2 S/ ! D L h +89 " " ! ! " " I +P
+, " $ C 3 "; + & : m ! 7 = " " $ C 8 " … " &
%" 0 .3 "; + 7 3 8J 2 S/ ! 2 # „ +89 " +O& +P +, 5 " / *
1 ! &0
• 8 /) Nn " & ] D ! ! " " … +89 ! 8> L &<
7 = O $! 7 /0 A@ " & $; h : , / * 1 @ > + , $! 7 / O ? 7 =
,/ * 1 @ > +, " 3 7 40
AZ *N
. F ! : ! !$! +89 3/ * C 89 $! 7 / 8 ] f ! N
[email protected] Page 22 of 44
iC +C $; / " ! !$! [ … '! 7 / … P! & . P g 6 0 g: f & N
"/& ! !2 " 2 L000 [ +p! $! 7 / " #! ! … ! +: f O 89 w 3 ! ! " "
! ! " " 0 8 !/ 5 "/ " H +.8 .E 8S " 8> 9/ & 4 "/ " 4
G G " B /
%! ! (0 g p! 3 ! ! " 8! " ? " / ! ! " ( f Z ':[ 0g 8
6& ! !$! F & f " ] ; Z \ ] ':[ 0 gC ! e H
8 .E 8S !& G U+ G
" B / %! ! ( ] 3 " / ! ! " f +89 " $! 7 ! !$! ; 3
: Z \ 3 $ ':[ J 0
.o L t 3 5 [ 8 8 / "
0 Š! [ & C X ! C A +_ : p! / * 1 8 7 +e 3 C
W / l 6 ] : : p! 7 3 ! 0
[email protected] Page 23 of 44
4.4. Backup Database
^ + J Q# ?
S B %!
V"
/‚! / ‹ 7‹ 2 ‹… '! 7 /# ‹ 2 ‹BN• '! 7 / •… 0$!7‹
[email protected] Page 24 of 44
! +: w! 5& " &< O P! ! !$! e 3 "/ " Z 9/0 D! : , "
$! 7 / +X 7•0
[email protected] Page 25 of 44
gC $; " [ ! 7 3 P! !& [ 7 3 $; : e G
"/ " e $! 7 / I $! 7 /( 8 4 0
[email protected] Page 26 of 44
'; : , e ! ! !$! "/ ! " ! !& " "/ ! " ! 5& " 8> 9/ 8 +r
Z < 0
[email protected] Page 27 of 44
Bài 5: Data Integrity and Advanced Query Technique
5.2. Constraints
/R / D
[email protected] Page 28 of 44
i K ! & i & +89 ;" ! S J L f +89 w+ ;" ! +, & ] Z & ? 0 gC
" !$ +: 8! : . J L ] S Œ. J L f +89 ;" !0
!&
9 1
• +7 N N F / N M 7 [ J 6 N , Z # 3 / /0 g< @ h
: K ! & i & ." ! " !$ " 7 ! : , : _ S ." ! <
!$ 0
• +7 N N ` a + 0S " ! : , 3/ +Q < 4! 3 Xg
" 7 / !&7 & " ! ]7 = 0
G R /
!&
[email protected] Page 29 of 44
CREATE TABLE Table1
(Col1 INT PRIMARY KEY,
Col2 INT,
CONSTRAINT col2_fk FOREIGN KEY (Col2)
REFERENCES Employees (EmployeeID)
)
.: , ;" ! . 7 ." ! 8 ! N
[email protected] Page 30 of 44
5.3. Advanced Query Techniques
B B.D ‚
† JgDu `‚ !$ ‡
… u% !$ ‚ " † aŠB B ! ‚ " " ‡
† V uSK '‰ " /‚$&‚ L/ " ‡
† ŠWAJgV ! ‚ " " ‡
† u #B '‰ " ‚ L/ " † W . › #B . ‡ ‡
• ( N d= 7 F ! " B B.D ! m +e F ! : , 5 ! !
4 [ !& C !& [ C } ( @ 7 &`" W !& 7 = : 7 &`" W N !$ ‚ ! W
!$ ‚! ! !& !$ ‚ ! !$ ‚! ! 0 AZ *N
USE pubs
SELECT p.pub_id, p.pub_name AS PubName
FROM publishers AS p
[email protected] Page 31 of 44
Region
FROM Northwind.dbo.Employees
ORDER BY LastName, FirstName ASC
+ .
% 3 7 3 o !! [ !& _ !$ " !$ 7 3 5 G
UUU UUUG0 g 8 Y &7 = ;" ! !$ @0 g p! ! !$ +: / 1 ; 8@ 0
AZ *N
. F 7 = : GE G " Y J &0
Q8.9 -S H(E +Q
9+ .+
[email protected] Page 32 of 44
S " 7 &`" : * ƒ/ 7C P! !& _ ; 7C 0
AZ *N
gC 7 = : 7 &`" W ] ! [ !$ f hL ? O " 7C 0
.s 7 5 W ] 3 " !$ +_ : " 7C $? ?/ 6/ ; 0
. d
USE Pubs
SELECT a.Au_fname, a.Au_lname, p.Pub_name
FROM Authors a LEFT OUTER JOIN Publishers p
ON a.City = p.City
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC
8 . d
[email protected] Page 33 of 44
#5 u š" +, !! [ !& _ !$ " +: ? $< !$ 4 ! 7 =
1 ; $< !$ 4 ? f +89 @ 3 3 X P! 3 +89 v" 0 +89
f $q @ P! !$ 4 ! 0 D4 / O = +\ < ] 0 AZ *N
USE Pubs
SELECT a.Au_fname, a.Au_lname, p.Pub_name
FROM Authors a RIGHT OUTER JOIN Publishers p
ON a.City = p.City
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC
G . d
USE Pubs
SELECT a.Au_fname, a.Au_lname, p.Pub_name
FROM Authors a FULL OUTER JOIN Publishers p
ON a.City = p.City
ORDER BY p.Pub_name ASC, a.Au_lname ASC, a.Au_fname ASC
USE pubs
SELECT au_fname, au_lname, pub_name
FROM authors CROSS JOIN publishers
WHERE authors.city = publishers.city
ORDER BY au_lname DESC
[email protected] Page 34 of 44
Bài 6: Stored Procedure and Advance T-SQL
D" $ & F ! f ] , 3 /" L/" !! " 0 ! +: f
$ ! 3 "; " K" . "0
d, : , !! " #! !$! 2 ! ! I / : ; $ p! : ? F
0 . F 7 ! ! +89 $ 7 "/& "/& "; 5 $ / !& 'S i Jg B D( " !$
" ] !$ +: / 1 ; ! ! +89 < " !// (0 g 89 ; 7 L/" !!
! !!I ] I @ f +89 ;" ! "Q ! ! I f $X " ` C : 1 ;0
N $ 7 "/& 5 7, . !! . !( C 7 = h t ] f 5 GDW'G ! !
• ( +, / Y +X 3 5 ` !! • ( +, / Y +X 3 8 3 3 X I! (0
[email protected] Page 35 of 44
1 / N " $ C +Y& & 47 = / !$ 0
9N ! 5 +, " "
d= 7 F ! !! [ ! !$! & 7 3 8 % W 2 u! 2
#' 000 !& 6 Z [ 7 3 ! O / 5 $ &0 f 5 7{
6 u B#' 3 WKJ +, &, 3 & & @ 3 ! !$! & 7 3 0 .: 3 +, & 6/ "
3 ! !$! & 7 3 5 JgiB# B AB W Š" ." / g! 0
% ) Y ! / 4 Y 8 5
! + I 0 ! +: 6/ " < P! 7
7 K! #'2 " / O + e % " "I š U0 u B#' K " 0 D" / O
6/ " X Z P! W ! !$! .N•K ! #'0 $( 7 ui0
[email protected] Page 36 of 44
Select * from OPENQUERY(LinkedPracticeDB,'Select * from Customers')
( H +
6.3. Cursors
OPEN Employee_Cursor
[email protected] Page 37 of 44
FETCH NEXT FROM Employee_Cursor INTO @au_lname, @au_fname
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Author:' + @au_fname + ' ' + @au_lname
FETCH NEXT FROM Employee_Cursor INTO @au_lname, @au_fname
END
CLOSE Employee_Cursor
DEALLOCATE Employee_Cursor
" K" : 8 +, Z 8 ! N
• Ni w Y ] / 7, !/ " L
Y +: : +89 / ƒ/ w Y !& 7 = +1 > 7, ! F / 3/ 1 @ ;"
! L /! w 0 gC : _ Y 8 6& ! `" 7 : ,
+ + P! 0 f C 5 " /" ]
8> h Y + h 7, ! O ! +: ;" ! L
/! w 0 gC " /" +89 e _ O ] L / ! : , +89 ) * ;
< f ! 0g " ! F / 3/ P! 3 Y +r +89 7, !
8@ 7 ! < :7 = O 7, ; 7 w 0
[email protected] Page 38 of 44
• G I N% 7 " /" +89 ;" ! : : , +89 ) * ;0
d_ & f " $ " ] ! ! !$ &( m " 3 > !$
4 " , $< " " /" ( ! !$! 0 AZ * C : w !&
+- " +: _ Q " ] ! h !& +- " $< " " /" =0 g
4 * 5 " /" & : , f 7 = O / !& +- „ 8 Z @
$ @ 0 .o 8 3 = 6/ ] 7 3 " /" " / ƒ/ ! +8!
" 3 / /! ! ! ( _ 3 " / /! ! +1 > : o : 7
H e 3 " /" 7 3 0
• /NV ) F ! @ ; &L ? w C/ P! " +: "
!$ 2 ! : , C " /" +, & L ? h " / ƒ/ +:
+89 ) * " /" +r C ™ = 47 = , G+* G +C 3 !$ +:
3 w C/0 g " ! " /" : , +89 &/ r :!( +, H 8> Z $ "
60
[email protected] Page 39 of 44
"( . " g! ! " (0 ! +: ! _ 7C " $C +: : = !&
7 = 0 • = 0
[email protected] Page 40 of 44
d, ;" ! " /" ! 5 . BWDB K u.B#S B " ! < P! : C
/" ! & " /" ] < ? ž 8@ < P! / " 0 gC &/ ] 5 aJDŠ
Bg. ‰KDJug 8@ W ( 3 / "Q " / /! ! 0 gC " / ] < 7 &`" uSDKSD
+q ! /! ! 0 D! : , " 3 X I! 5 F @ 7 ! $3" ! ! &/ P! /! ! 0 i, [ !
W / O $" & P! " /" 0
! 7 8> " @ ! C/ * = $q 7, ! L u
: 1 ; 8! ] C " +r 1 ; ] 7 f $3" “ " u J# K !&
7 &(0 gC 8" < ] " " +: +r : " #' ] ! " $! 7 7C •| s C 7 = ]
! " @ " " ! ! " @ 7C _• 0
% , t _$ e & $; O $ 6/ 0
[email protected] Page 41 of 44
Bài 7: Triggers And Views
[email protected] Page 42 of 44
)@ @
' |N V @ D 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000|
|0|0 . dQ J ! ! " (000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000|
|0 0 % F 7C 4 _ 3 A " P! 0000000000000000000000000000000000000000000000000000000000000000000000000
|0R0 .3 / O ! e " 00000000000000000000000000000000000000000000000000000000000000000000000
|0R0|0 ! " ! #! !$! B 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0 0 / ! " 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0R0 #! ! D ! I" ! " #D 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0U0 W ! & E 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0j0 B & E 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0T0 % ! #! ! N 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0M0 '""7 u E 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000R
|0R0c0 D"" E 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000U
' N V@ D 89 A_ D ! ! DE ( 0000000000000000000000000000000000000000000000000000000000000000000000000000000000j
0|0 #! ! # I " ! ! ## (N00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000j
0 0 #! ! ." " ! ! #. (N000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000j
0R0 %! / ! " ! ! #% (N00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000T
' RN # ! J / ! #! !$! 00000000000000000000000000000000000000000000000000000000000000000000000000000 |
R0|0 .? D F .P! 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
R0 0 .? D F A6 .P! % #! !$! 000000000000000000000000000000000000000000000000000000000000000000000000000 |
R0R0 g &< D} Š"; d .P! D ! ! " " D" 000000000000000000000000000000000000000000000000000 |R
R0U0 .? D F " .P! % #! !$! 00000000000000000000000000000000000000000000000000000000000000000000000000000 |j
R0j0 .3 ;" S #! !$! 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |T
R0T0 g d, .O 8 Ÿi D C iC % #! !$! 000000000000000000000000000000000000000000000000000000000000000000000 |c
' UN '! 7 / W " 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
U0|0 . C 89 K * Š1 # #! ! "! " ! &(000000000000000000000000000000000000000000000000000000000000 |
U0 0 .3 "; '! 7 / 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
U0R0 " & %" 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 |
U0U0 '! 7 / #! !$! 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 U
U0j0 " #! !$! 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 j
' jN #! ! J &! W ! &D 00000000000000000000000000000000000000000000000000000000000000000000000000000 c
j0|0 .3 K 8 K 3/ d ' " #! ! J & 0000000000000000000000000000000000000000000000000000000000000000000000000000000000 c
j0 0 ." ! 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 c
j0R0 W ! &D 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 R|
j0U0 S šuJg 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 RR
' TN " K" ! W ! DE 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Rj
T0|0 ) * $ / 'S i Jg B D +, /" ! ! 00000000000000000000000000000000000000000000000000000000000000000000000000000 Rj
T0 0 # $ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 RT
[email protected] Page 43 of 44
T0R0 . " 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 RM
T0U0 " K" 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Rc
T0U0|0 d, .P! " K" 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Rc
T0U0 0 .3 "; " K" 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Rb
T0U0R0 A C " K" 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 Rb
' MN D W A ` 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 U
[email protected] Page 44 of 44