Professional Documents
Culture Documents
-L
DATE:
t\ a
- --be bu**
n{kx'' *>- -> *4X# *1
\
v1 faz q*t$,ihufi, Ai U Jc^r )rr. , o{- a-Ao{+ p!+f*a, btt(I ^t*rvo-
8,&t
\4 a
s L*t ) 4 ,l^yrn
\a Y
fufibrt&t Ji ,hlt, *vt,,,;b tJLEr a#;bu*<rte
v
M (tr) s{ trluLL,
,.1
3fi&v6"[,ut ,rit b^*lL+ 4^d4]u&L i*r*,xu^ggn*tJ.tB &rL aJtlib;u..b Ai
T_-.-
t
h e.6 t{* I f,t 96 f,, *; I
a
tH - fuft{A *.ed-" Js
t* anr,ta,ti $'
2, &h 4- k?-
I Y rc il-fl
f**r*?sel tf h^A*-t) {
f".*-#*.,ilt+,L]**
*rc t .fo,* * : *- ". -. l
i^;,t.;",i:?1 "
A
I
!
$
I
-t:
}'
"
{*-}*-ut*}'tj,} i
\
re *+. - , i'::
i Et ;
#-ee
t
fLq i., t i ,if #, f}' ac ffI
RI,LATIONAL MODEL CONSTRAINTS
1 . Inherent Model-Based constraints (Implicit constraints) :
- Constraints inherent in the data model
- Ex: no duplicate tuples, absence of ordering of
tuples, and restrictions on composite attributes
2. Schema-Based Constraints (Explicit Constraints) :
- Constraints expressed directly in the schemas of the
data model. Specified in DDL
- Examples: domain constraints, key constraints,
constraints on NULLs, Entity IC, Referential IC
3. Application-Based or Semantic constraints (Business
Rules):
- Constraints not directly expressible in the data model schemas.
Must be enforced by application
programs or other means. Ex: Assertions and triggers in
SeL.
Types of schema-Based constraints (Expricit constrainis)
1. Domain Constraints:
- Values of attributes must be atomic values frcm
fl1.i, respective domains.
- Domains include integers, real numbers, characterc.
BooGans, strings, date,time,and timestamp.
2. Key Constraints:
- superkey: subset of attributes ensuring uniqueness of
tupres.
- Key: Minimal superkey; uniquely identifies tuples.
- Candidate key: Altemative keys.
- Primary key: Designated key for identifying tuples.
- Examples: Keys in the sruDENT relation
andcAR relation.
3. Constraints on NULL yalues:
- Specifu whether NULL values are allowed for attributes.
- Example: Name attribute of STUDENT cannot be
NULL.
4. Entify Integrity:
- Primary key values cannot be NULL.
- Ensures identification of individual tuples.
- Example: Ensuring distinct primary key values
in EMpLoyEE relation.
5. Referential Integrity and Foreign Keys:
- Ensures consistency among tuples in related relations.
- Foreign keys reference primary keys in
other relations.
- Example: Dno attribute in EMPLOYEE referencing
Dnumber in DEpARTMENT.
- Diagrammatically displayed using directed
arcs.
I II
I
RELATIONAL ALGEBRA
Unar-voperation. _ /a\ R;aj4Jf-On R
1. The SELECT Operation %on l,irnor,, LH J
The SELECT operation is used to choose a subset ofthe tuples &om a relation that satisfies
a selection
condition. It acts as a filter that keeps only those tuples that satisfy a qualifring condition
(rL'.- 1,? Lilt Jrah&#umrv vnY' w
't v 6*aeo
foq, -- e C sa4ler*)
2'
fi: IffiHEI3##[T*,""* *%mmr*]]"
*0," and discards the ot]rer cor'runs. rronry certain
at&ibutes of a relation are needed, &en the PROIECT operation is used to project &e relation
over these
athibutes only
h'.-aorrkE.,,rf dL ugNs fl us,v ( ger^fu^*\
3' RENAME operation can rename eitherthe relation name or the athibute names, or both-as
a unary operator.
The genere-l is denoted by any of the following three forms:
'pt"d - t* Yq,rn{ydt4{-.
L ,IZ
*.
*s/
tz
T
t
L ( t
B
3 ,11
c}
-{* le
B
r3
3 l3
u ,1
{i'.ts
.
.F
$
t' t
+ $+
2 IL
3 t3
+ r+
,
t:
-IIt-fiFF
,a
a]
1?
o g)
3.1,.{r
I
b
t
*
i\t
{ -j'
t-t
i1
* Rxg-
lr
{ +
,' r t'
ir
lu-
i+
I
-r
V
8.,
I
'L {a
,=t
;ts:.-::
.
.,s-$\J .
-.l i,"ji.* B*: r/.i
E
tF
E
+
f
l*
'-J lh
J :t
e *
,.t
g::_
,\!.,-It ag
.I S&ur, tu
.a-
aa-
+e %
.,1
$ *ea L) i -t J*m '€ I
$
\l^ r NIJ
/\0
L Y
11
\ ,
k-t\tr d
d
€rnP
fru, * ?
eEsE&R d*+DsP
N# #t.ru#
3
I
t;,)ti..-' :k
LlSl* &fanrwe
e
&
ft $
ii
ti
US r{ t' jl'irt+.€- Sr; Pf:
n fr q,. g
3
a "..
3E*\
t. t i:
l.J
1"i;#
-b
.*
fa r..r ****-
r .ji
Lrj d
.L
1
?
t.
-t
*"+
t
i--.' !
+ .1i
!jj
* re1 Bniqh I
J
'- Lr Lbf{r lC,-t >5n L= Y>rr1:
.r* R- s-\ aJ.-g* in "s ffL4u_ &
\
T t!-* * I
iJ
I A , I. ; *",$.*
B I-'i
c 3
TL
a
-,J
ffierE@
tu
*.#i**;i*; . i r.f* EU
o{
FerHa-*ais
T
iCii-.*Lfi$fi.E*.<ri-
d" p -?
e( { *
s B {
ft A * .A
I w
l' A I * t
t +
\,, B L I L 5 B l--
,1
r
s € C NULL 3 Ntl, 6 C 3 ilJULL
E
\=u
rtfxTz
t
TI reTL D NULI- €
tr
I
t
.!
l
U i
1,
t) lr
i
T tur*:@{ryie
'J,
SI
k@{ee!@ JC+{-
a
rlrt ill
T ll
.t
.!:
I 4r
r{ -J
i1
t:+*.
s )
+i
li
ll
11
E
lr
e@%-_ 't,"f ir
+:4. , .i -.- :
R. *
.:r
.i
)ltl
fi/tafii^d -n
J
!'
{h
I
r { a\
1i
\*
e ": C,g ti
Nq/ryi"g . \-r:'i .t.r il
ji
t i i-q
-.ta-r: ,l
C"'g
A li
rl
Fl I
.t
\rz
x \ li
tl
I
;-.11 1oi ,L$ 1l
{l
{d
r.t
r-J
ll
tl I
_$ 'l
it
\
t\
:-t
'ti
e..@.-*.
, il
t
ir
_t
1
*..l%..*-,n,@i.*..
b ,l
1
S-* t
It ,-*'i S
1
i
I
i
J
1
uvv,*c4&
H ,r.-iY ',.-i{.:
.J!-
*. i;.'
gf €-Z
Cs e3 Lz €-g
a
\-,
,{-
f)
€-3 9g-
eg p
\r +-
E.#l €,-q-
I
i
?-.* €q-
+-
\
CTlcft] S E[V U:
'(t
*
- SH#l
-t- -M 6 L
f\,4#
Elr^A *J&qtL&#e !.
I
i
i
,
I
t
C
r
gb _\
b 0^*l !
*#
FE
Pg"F * n*,pxg $"9
q,tp+
I
w r:{v 4 .(
3i& f\\
JffiJa w T
F-
.J e.-.Ss
$* f.'
s &*k
t
i
?
A€kiwen
fIr .{
.:
€
g,ttPs hsq rv!: 4Ajtrn)"
---f-"-
EAI tt X
.t& r.i
;-
t
ii
fr-i i \
:E
't li
"
tt1* *
,.-.;a J
1 *{r
i.i 3**+ ' -\*oi
\f'*}
,.-d i;^
:
lrl-J r-1{'
rF ,'.-i: ,,, ;f i_,Tii t , -!
:
r*
t**
t 'u d. Pan *,-t
a*'-\ 'rt'i
.3 *
], ,i :i .Ftiut 1 '-. 'o',,
*
, t. '"!n..q" i
$,,q;b{r{ o
L
-- -{- € p ;. *:
---.I-:--' -' - - --'lJ--
/i
&ii--idra*@.
1t ilJ ,*
ts-1:,.'@!&*,r€{S
_t
.1 ..+.
*.i ,; -it t i r."- .i I r.'l i.,.,'. * ir]+-.t, .:tr
" I l,i .;-' . ,-*' i' - r,,-,i*,,,i G
- f .ii,.f t- irlf i* :i "l
.a@#',! Y.4
&"'s6.@kan-F
-:jll'rr;!:t!c@.+i..-r!.!^!i:s-
e-lfur'.q1llffi.M*-'r\-
i
i'r
,i1. t -td q t":"'$