Fundamental and Application of
Database
? o?¨$
? o?¨$
???
???
? e/
?D1???ù??
? e/
?D1???ù??
?¥t
?¥t
2.2.1 .d¥"?
?
z i
z μ
z ?
z <l2 5:
4. <l2 5:
Extended Cartesian Product
z R
– n"1" k
1
?íF
z S
– m"1" k
2
?íF
z R ?S
–
n+m
¥íF¥"?
z íF¥- n
^1" R¥B?íF
z a m
^1" S¥B?íF
– ?k
1
?k
2
?íF
z R ?S = {t
r
t
s
|t
r
∈R ?t
s
∈S }
2.2.2
ê¥1"
?
z ê4
z g?
z ?¤
z "
1. ê4
Selection
z 1) ê4??1K?
Restriction
z 2) ê4
??¥cl
– 1" R?ê4
?@ó?Hq¥ííF
6
F
(R) = {t|t∈R ?F(t)= '? '}
– Fê4Hq
^B?
? Vr
T'?
T1
X
1
, Y
1
[9 X
2
, Y
2
]…
z ,1?
??
# ?! ?" <>
z X
1
Y
1
?
?? aè
ae?f
?
?? 9 V[¨
?
¥?| ?}9
z 9
?
??
? ?
z [ ]V
U?ê[
z …V
U
?ì
T V[×ˉ/?
ê4
?
z 3) ê4
?
^V?¥?é?¥
?
z 4) è
!μB?D
3 - [?
? o ?D
31"
Student a [?1" Course?ê?1" SC b
6
2. g?
Projection
z 1g?
??¥cl
– V R?ê4??
??
F??¥1"
4
A
(R) = { t[A] | t ∈R }
AR?31
=¥
??
2. g?
Projection
z 2g??T?1
^V
¥?é?
?
– ?g?-a??|h
e1"?¥t
7O? V?|htíF
E
?×ˉ?
4
3. ?¤
Join
z 1 ?¤9?1, ?¤
z 2 ?¤
?¥cl
– V
?1"¥2 5:?ê|
??W
?@B?Hq
¥íF
R S = { | t
r
∈ R ?t
s
∈S ?t
r
[A], t
s
[B] }
z A?BsY1 R?S
V1¥
??F
z ,1?
??
– ?¤
?V R?S¥<l2 5: R ?S?ê|
R1
"A
??F
¥′D
S1" B
??F
′
?@1?1"¥íF b
A, B
t
r
t
s
?¤ (? )
z 3
?è¨ ?¤
?
– ?′ ?¤
equijoin
z
I
1
^?′ ?¤
–,1 “"”¥ ?¤
??1?′ ?¤
z ?′ ?¤¥cl
–V1" RD S¥<l2 5:?ê| A aB
??
′M?¥*tíF'?′ ?¤1
R S = { | t
r
∈R ?t
s
∈S ?t
r
[A] = t
s
[B] }
A=B
t
r
t
s
?¤ (? )
– 1? ?¤
Natural join
z
I
1
^1? ?¤
– 1? ?¤
^B?+
y¥?′ ?¤
?
?1"?é?1?¥s
A?
^M]
¥
??F
? 2T?ü×ˉ¥
??
??
z 1? ?¤¥cl
R?S μM]¥
??F B
RS= { | t
r
∈R ?t
s
∈S ?t
r
[B] = t
s
[B] }
t
r
t
s
?¤ (? )
?iB?¥ ?¤?T
^V?¥?é?
? b
?iB?¥ ?¤?T
^V?¥?é?
? b
1? ?¤?31|h×ˉ
?[
^]
H
1? ?¤?31|h×ˉ
?[
^]
H
V??
¥?é?
? b
V??
¥?é?
? b
A, B
R
S
?¤ (? )
z 5 è
A B C
a
1
b
1
5
a
1
b
2
6
a
2
b
3
8
a
2
b
4
12
B E
b
1
3
b
2
7
b
3
10
b
3
2
b
5
2
R
S
?¤ (? )
R S
A R.B C S.B E
a
1
b
1
5 b
2
7
a
1
b
1
5 b
3
10
a
1
b
2
6 b
2
7
a
1
b
2
6 b
3
10
a
2
b
3
8 b
3
10
C! E
?¤ (? )
?′ ?¤ RS
R.B=S.B
A R.B C S.B E
a
1
b
1
5 b
1
3
a
1
b
2
6 b
2
7
a
2
b
3
8 b
3
10
a
2
b
3
8 b
3
2
?¤ (? )
1? ?¤ RS
A B C E
a
1
b
1
5 3
a
1
b
2
6 7
a
2
b
3
8 10
a
2
b
3
8 2
4. "
Division
ó?1" 3 9 :
? 4 : ;
? 9 : ;1
??
F b
3?¥ :D 4?¥ : V[μ?]¥
?? ? A?1M]
¥×" b 3D 4¥"
?¤?B??¥1" 1 9
R ?S = P(x)
|t∈P(X), μ t ∈4
X
(R), 7O t ?4
Y
(S) ? R
" (? )
z 2"?T
^]
HV??
?é?
?
z 3 è
[ è 6]
?
R
S
" (? )
A B C
a
1
b
1
c
2
a
2
b
3
c
7
a
3
b
4
c
6
a
1
b
2
c
3
a
4
b
6
c
6
a
2
b
2
c
3
a
1
b
2
c
1
B C D
b
1
c
2
d
1
b
2
c
1
d
1
b
2
c
3
d
2
R ?S
A
a
1
R
S
2.2.3 ¨1"}
?V
U1"?T
[ è 1] °?D [?|1 1137¥D
3¥
D|??
4
Sno,Grade
(6
Cno=‘1137
( SC))
2.2.3 ¨1"}
?V
U1"?T
[ è 2] °?D [?|1 1137¥D
3¥
D|??
4
Sno,Sname
( S (6
Cno=‘1137
( SC)) )
[ è 5] °?à
ê? [?|1 1024?1136
¥D
3¥D|
4
1
(6
1=4^2=‘1024’^5=’1136’
( SC ? SC) )
°?a?
°?a?
aA1?
aa?|
{
aa?|
{
? ê4
?5S b K×1 aK'