HC VI
D LIU
.
H
Lp:D10CN1
Trung tin hc ng m lp tin hc ngn hn hn. Mi lp ngn hn mt hoc
nhiu hc (chng hn lp Tin hc : Word, Power Point, Excel, lp
lp Pascal ch hc mt lp hn (chng hn lp k thut ho,
truyn t lp k thut lp lp k thut phn cng m ) th hc nhiu hc
phn mi hc phn th nhiu hc.
: T
trung
ng thc th:
c th:
thc th , bao gc
- (MHV)
- (H&T)
- S n thoi
-
- (N/S)
- (GT)
- (NN)
:
Thc th , bao g
- )
- )
- (Ng KG)
- (HP)
:
Thc th , bao
g
- (MGV)
- (H&T)
- a ch
- S n thoi
:
thc th, bao g
thu
- (MMH)
- (TMH)
- (STH)
:
:
-
-
-
-R
MMH
TMH
STH
MGV
TGV
KG
MHV
H&T
N/S
GT
NN
Thi
IV: C TH .
:
S
:
rung T
N/S
G/T
:
:
:
S
:
IV: THC HI QUAN H BNG MYSQL
V: THC HIN BI S QUAN H.
1a tt c hi h truy vn
- n tt c ngh nghip:SV
r =
(ngh nghip=SV)
)
- Tin chiu kt qu H
=
(
(r)
=
( )
(
(ngh nghip=SV)
())
2: a tt c
:
Kt qu
()
((Gioitinh=1)AND(year(Ngaysinh)<1993))
))
3: a tt c 10/2012 .p cn truy v
- a chn tt c 10 .
r =
(=10 )
)
- Tiu kt qu
=
()
(r)
=
)
(
( =10 )
))
4: l:
:
Kt qu
(#)
)
))
5: ++.
:
Kt qu
()
(#) AND
(= CCNA) AND (++) AND (#))
( ))
6: a tt c
CCNA.
:
=
)
(
(( = T..= CCNA) AN
# =.#)
#)
(
))
7:
:
Kt qu
(#,)
(#) AND
(= CCNA) AND (
( ))
8:++
:
Kt qu
()
(#) AND
(++) AND () AND (.M
#))
( ))
9: CCNA .
:
Kt qu
()
(#) AND
(= CCNA) AND (#)
( ))
10: Li.
:
= spj (
) )).
thu quan h dng chun 3 (3NF)
:
((C)).
1={ABC1 ={A}
.
3NF
:
(E)).
2={AB,BCDE2 ={A,B}
C,D,E.
3NF.
3NF
:
B}.
CDE}.
:
(A),
(F)).
Vi tp ph thu={ABC,CDEF={A,C}
Thu ph thuc bc c
dng 3NF.
dng 3NF
Quan h con
_(ABC thu={ABC}
Phong_(CDEFC , ph thu={CDEF}
.
( (D), S n thoi
(F)(G)(H)(J)).
Vi tp ph thu={ABC,CDEFGHJ={A,C}
Thu ph thuc bc c
dng 3NF.
dng 3NF
Quan h con
(ABC thu={ABC}
_CDEFGHJC , ph thuDEFGHJ}
.
( (B),(D)(E) ).
Vi tp ph thu={ABC,CDE={A,C}
Thu ph thuc bc c
dng 3NF.
dng 3NF
Quan h con
(ABC thu={ABC}
_CDEFGHJC , ph thuDE}
.
((B)).
Vi tp ph thu={AB,B={A,B}
thuc cu trong quan h
dng 3NF.
VII: Thc hin b SQL.
1: a tt c hi .
2: a tt c .
WHERE )<1993.
3: ca tt c 10/2012 .
SELECT
FROM
WHERE ) = 10 AND
) = 2012.
4: .
SELECT
FROM
WHERE .
5: ++.
SELECT
FROM
WHERE = C++
.
6: ca tt c
.
SELECT
FROM
WHERE )=2012
= CCNA
.
7: .
SELECT
FROM
WHERE )=9
)=2012.
8: .
SELECT
FROM
WHERE .
9: 9
SELECT
FROM ,L
WHERE = CCNA AND
)=1
)=9
)=2012
.
10: Li .
SELECT
FROM
WHERE .