rt503_dbms_module1__2 mg university

Upload: aby-panthalanickal

Post on 02-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    1/25

    RAJAGIRI SCHOOL OF ENGINEERING AND TECHNOLOGY

    Rajagiri Valley, Kochi !"

    TEACHING NOTES

    RT503 DATABASE MANAGEMENT SYSTEMS

    MODULE 1 DBMS Basic Concepts

    #or

    B.TEC . COM!UTER SC"ENCE # ENG"NEER"NG BRANC

    FIFTH SE$ESTER

    J%&e '(("

    !$epa$e% B&

    K) S) $a*he+,

    A ocia*e -ro#e or, De.*) o# CSE

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    2/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    Ta/le o# Co&*e&*

    1. INTRODUCTION TO DATABASE SYSTEMS........................................... ........ ..3

    0)0 1 ASIC C ONCE-TS ............................................................................................30)' H ISTORY OF D1$S ........................................................................................40)! D ISADVANTAGES OF FILE SYSTE$ ..............................................................70)2 A DVANTAGES OF D1$S ................................................................................80)3 D ISADVANTAGES OF D1$S .........................................................................90)4 D1$S F ACILITIES ........................................................................................100)5 D1$S 6 SERS ................................................................................................100)7 D1$S C O$-ONENTS ...................................................................................120)" D ATA $ ODELS ................................................................................................140)0( D1$S A RCHITECT6RE AND D ATA I NDE-ENDENCE .........................170)00 E NTITY R ELATIONSHI- $ ODEL .............................................................19

    11/20/2014 2

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    3/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    0) I&*ro8%c*io& *o Da*a/a e Sy *e9

    0)0 1a ic Co&ce.*

    Da*a a$e $a* +acts an% +i,'$es t-at constit'te 'i(%in, (oc/s o+ so e in+o$ ation.

    Da*a/a e is a co((ection o+ in+o$ ation o$ pe$sistent %ata2 an% a eans to anip'(ate

    %ata in a 'se+'( *a& *-ic- 'st p$o4i%e p$ope$ sto$a,e +o$ (a$,e a o'nts o+ %ata eas&

    an% +ast access an% +aci(itate t-e p$ocessin, o+ %ata. Da*a/a e $a&age9e&* Sy *e9

    :D1$S; is a set o+ so+t*a$e t-at is 'se% to %e+ine sto$e anip'(ate an% cont$o( t-e %ata

    in a %ata ase.

    A Da*a/a e Sy *e9 is a co p'te$i e% $eco$% /eepin, s&ste *-ose o4e$a(( p'$pose is to

    sto$e in+o$ ation an% to a((o* 'se$s to $et$ie4e an% 'p%ate t-at in+o$ ation on %e an%.

    Data ase s&ste consists o+ a Data ase Data ase Mana,e ent S&ste an% an

    App(ication p$o,$a .

    6i,. 1.1 A Data ase S&ste

    T-e %ata ase is 'se% & t-e %ata ase s&ste 7$eco$% /eepin, app(ication s&ste 8 o+ so e

    o$,ani ation. E9a p(es o+ o$,ani ations a$e: a an'+act'$in, co pan& a an/ a -ospita(

    a 'ni4e$sit& o$ a ,o4e$n ent %epa$t ent. T-e %ata in t-e %ata ase co'(% e p$o%'ct %ata

    acco'nt %ata patient %ata st'%ent %ata o$ p(annin, %ata. A %ata ase -as t-e +o((o*in,

    i p(icit p$ope$ties:

    A %ata ase $ep$esents so e aspect o+ t-e $ea( *o$(%

    A %ata ase is a (o,ica((& co-e$ent co((ection o+ %ata A %ata ase is %esi,ne% 'i(t an% pop'(ate% *it- %ata +o$ a speci+ic p'$pose

    6o$ e9a p(e: St'%ent %ata ase

    Ro(( No. Na e B$anc- ; o+ Ma$/s G$a%e

    11/20/2014 3

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    4/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    "n a %ata ase s&ste 'se$s access t-e %ata ase t-$o',- an inte$ e%iate (a&e$ o+

    so+t*a$e /no*n as a Da*a/a e $a&age9e&* Sy *e9 :D1$S; . T-e o

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    5/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    D'p(ication: Sa e %ata is -e(% & %i++e$ent p$o,$a s t-'s *astes space

    an% $eso'$ces.

    i,- aintenance costs s'c- as ens'in, %ata consistenc& an% cont$o((in,

    access

    S-a$in, ,$an'(a$it& is 4e$& coa$se

    ea/ Sec'$it&

    Era o# &o& rela*io&al :Na 8a*a 9o8el

    Ea$(& 1?@0s C-a$(es Bac- ann %e4e(ope% +i$st DBMS at one&*e(( "nte,$ate%

    Data Sto$e 7 "DS8

    "t *as stan%a$%i e% in 1?F1 & t-e CODASYL ,$o'p 7Con+e$ence on Data S&ste s

    Lan,'a,es8

    11/20/2014 5

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    6/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    "%enti+ie% 3 %ata ase co ponent: Net*o$/ sc-e aI%ata ase o$,ani ationH

    S' sc-e aI4ie* s o+ %ata ase pe$ 'se$H Data ana,e ent (an,'a,e )) at (o*

    (e4e( an% p$oce%'$a(

    Eac- $eco$% can -a4e '(tip(e pa$ents:

    o Co pose% o+ sets $e(ations-ips a set $ep$esents a one)) an& $e(ations-ip

    et*een t-e o*ne$ an% t-e e e$

    o Eac- set -as o*ne$ $eco$% an% e e$ $eco$%

    o Me e$ a& -a4e se4e$a( o*ne$s

    Main p$o (e :

    o S&ste co p(e9it& an% %i++ic'(t to %esi,n an% aintainH Lac/ o+ st$'ct'$a(

    in%epen%ence

    The distinction of storing data in files and databases is that databases are intended to be

    used by multiple programs and types of users.

    0"5( .re e&* Era o# rela*io&al 8a*a/a e a&8 Da*a/a e $a&age9e&* Sy *e9

    :D1$S;= (ased on relational calculus, shared collection of logically related data and a

    description of this data, designed to meet the information needs of an organi ation;

    *ystem catalog/metadata pro%ides description of data to enable program+data

    independence; logically related data comprises entities, attributes, and relationships of an

    organi ation)s information. Data abstraction allo&s view eve , a &ay of presenting data

    to a group of users and ogi!a eve , ho& data is understood to be &hen &riting ueries.

    1?F0: Te% Co%% at "BM s San Jose La p$opose% $e(ationa( o%e(s.

    1?F )F?: S&ste R at "BM san Jose La (ate$ e4o(4e% into S>LKDS 7in 1?F?8 an%

    t-en to DB= 7in 1? 38 *-ic- eca e one o+ t-e +i$st DBMS p$o%'ct ase% on t-e

    $e(ationa( o%e( # S>L.

    1?F@: !ete$ C-en %e+ine% t-e Entit&)$e(ations-ip7ER8 o%e(

    1?F : La$$& E((ison $e(ease% +i$st 4e$sion o+ O$ac(e 7 ase% on "BMs pape$s on

    S&ste R8 L stan%a$% a%opte% & "SO an% ANS".

    1? 5: O

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    7/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    1??0s: inco$po$ation o+ o

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    8/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    A*o9ici*y .ro/le9 = Ato icit& o+ t$ansactions cannot e aintaine% in +i(e s&ste

    app$oac-. "+ an& +ai('$e occ'$s %'$in, e9ec'tion o+ a t$ansaction p$o,$a t-en t-e

    e9ec'tion stops. T-is (ea%s to inconsistenc& o+ %ata in t-e %ata ase.

    Co&c%rre&* acce a&o9alie = Conc'$$ent 'p%ates o+ +i(es & '(tip(e 'se$s *i(( $es'(t

    in inconsistenc& o+ %ata.

    Sec%ri*y .ro/le9 = Di++ic'(t to en+o$ce sec'$it& const$aint eca'se app(ication p$o,$a s

    a$e a%%e% to t-e s&ste in a%)-oc anne$.

    0)2 A8

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    9/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    accessin, t-e %ata. T-e %ata access a(so eco es e++ecti4e *it- t-e 'se o+ DBMS an%

    -ence it p$o4i%es ette$ se$4ices to t-e 'se$s.

    Da*a re8%&8a&cy ? i&co& i *e&cy ca& /e re9o

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    10/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    Co * o# 9ai&*ai&i&g a 8a*a/a e= T-e cost o+ %e4e(opin, an% aintainin, an app(ication

    p$o,$a 'sin, DBMS is (o*e$ t-an t-at in %e4e(opin, app(ications 'sin, +i(e s&ste . B't

    t-e -a$%*a$e an% so+t*a$e p$ice +o$ %ep(o&in, an% aintainin, a DBMS is si,ni+icant. A(so

    t-e$e *o'(% e an a%%itiona( cost +o$ i,$ation o+ %ata +$o t-e t$a%itiona( +i(e s&ste to

    %ata ase s&ste .

    Coi8e&*iali*y, -ri

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    11/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    !e$+o$ ac/'p an% $eco4e$&

    0)5 D1$S 6 er

    T-e peop(eK'se$s in4o(4e% in a %ata ase s&ste en4i$on ent can e c(assi+ie% into t*o

    ,$o'ps na e(& 7a8 Acto$s on t-e scene an% 7 8 Acto$s e-in% t-e scene. T-e acto$s on t-e

    scene inc('%e: %ata ase a% inist$ato$s %ata ase %esi,ne$s en% 'se$s an% app(ication

    p$o,$a e$sKs&ste ana(&st 7so+t*a$e en,inee$s8. T-e acto$s e-in% t-e scene inc('%e:

    DBMS s&ste %esi,ne$s an% i p(e ente$s Too( %e4e(ope$s an% ope$ato$s # aintenance

    pe$sonne(.

    Da*a/a e A89i&i *ra*or = Since an& peop(e 'se %ata ase $eso'$ces conc'$$ent(& in a

    %ata ase en4i$on ent t-e$e is a nee% +o$ a c-ie+ a% inist$ato$ to o4e$see an% ana,e

    t-ese $eso'$ces. "n a %ata ase en4i$on ent t-e p$i a$& $eso'$ce is t-e %ata ase itse(+

    an% secon%a$& $eso'$ce is t-e DBMS an% $e(ate% so+t*a$e. A% iniste$in, t-ese $eso'$cesis t-e $esponsi i(it& o+ %ata ase a% inist$ato$ 7DBA8. T-e DBA is $esponsi (e +o$

    a't-o$i in, access to t-e %ata ase +o$ coo$%inatin, an% onito$in, its 'se an% +o$

    ac 'i$in, so+t*a$e an% -a$%*a$e $eso'$ces as nee%e%. T-e DBA is acco'nta (e +o$

    p$o (e s s'c- as $eac- o+ sec'$it& o$ poo$ s&ste $esponse ti e.

    Da*a/a e De ig&er = Data ase %esi,ne$s a$e $esponsi (e +o$ i%enti+&in, t-e %ata to e

    sto$e% in t-e %ata ase an% +o$ c-oosin, app$op$iate st$'ct'$es to $ep$esent an% sto$e t-is

    %ata. Data ase %esi,ne$s inte$act *it- eac- potentia( ,$o'p o+ %ata ase 'se$s in o$%e$ to

    'n%e$stan% t-ei$ $e 'i$e ents an% co e 'p *it- a %esi,n t-at eets t-e %ata an%p$ocessin, $e 'i$e ents o+ t-is ,$o'p. T-e +ina( %ata ase %esi,n 'st e capa (e o+

    s'ppo$tin, t-e $e 'i$e ents o+ a(( 'se$ ,$o'ps.

    E&8 6 er = En% 'se$s a$e cate,o$ies o+ peop(e *-o $e 'i$e access to t-e %ata ase +o$

    'e$&in, 'p%atin, an% ,ene$atin, $epo$tsH t-e %ata ase p$i a$i(& e9ists +o$ t-ei$ 'se.

    T-e$e a$e se4e$a( cate,o$ies o+ en% 'se$s *-ic- a$e (iste% e(o*:

    Cas'a( en% 'se$s: T-e& a$e occasiona( %ata ase 'se$s t&pica((& i%%(e o$ -i,- (e4e(

    ana,e$s *-o nee% %i++e$ent in+o$ ation eac- ti e. ence t-e& 'se sop-isticate% 'e$&

    (an,'a,e to ,et t-e in+o$ ation t-e& nee%. Cas'a( 'se$s (ea$n on(& a +e* +aci(ities t-at

    t-e& a& 'se $epeate%(&.

    Na 4e o$ pa$a et$ic en% 'se$s: Ma

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    12/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    teste% in t-e app(ication p$o,$a s. T-ese 'se$s inc('%e Ban/ te((e$s Rese$4ation c(e$/s +o$

    $ai(*a&s ai$(ine etc. Na 4e 'se$s -a4e to 'n%e$stan% on(& t-e t&pes o+ stan%a$%

    t$ansactions %esi,ne% an% i p(e ente% +o$ t-ei$ 'se an% t-e& nee% to /no* on(& 4e$&

    (itt(e a o't t-e +aci(ities p$o4i%e% & DBMS.

    Sop-isticate% en% 'se$s: T-ese 'se$s inc('%e en,inee$s scientists 'siness ana(&sts an%

    ot-e$s *-o t-o$o',-(& +a i(ia$i e t-e se(4es *it- t-e +aci(ities o+ t-e DBMS so as to

    i p(e ent t-ei$ app(ications to eet t-ei$ co p(e9 $e 'i$e ents. Sop-isticate% 'se$s t$&

    to (ea$n ost o+ t-e DBMS +aci(ities in o$%e$ to ac-ie4e t-ei$ co p(e9 $e 'i$e ents.

    Stan%)a(one 'se$s: T-ese a$e in%i4i%'a(s *-o aintain pe$sona( %ata ases & 'sin,

    +'nctions p$o4i%e% & $ea%&) a%e p$o,$a pac/a,es t-$o',- 'se$ +$ien%(&Ksi p(e

    inte$+aces. An e9a p(e is t-e 'se$ o+ a ta9 pac/a,e t-at sto$es a 4a$iet& o+ pe$sona(

    +inancia( %ata +o$ ta9 p'$poses. Stan%)a(one 'se$s t&pica((& eco e 4e$& p$o+icient in 'sin,a speci+ic so+t*a$e pac/a,e.

    Sy *e9 A&aly * a&8 A..lica*io& -rogra99er :So#*+are E&gi&eer ;= S&ste

    Ana(&sts %ete$ ine t-e $e 'i$e ents o+ en% 'se$s especia((& na 4e 'se$s an% %e4e(op

    speci+ications +o$ canne% t$ansactions t-at eet t-ese $e 'i$e ents. App(ication

    p$o,$a e$s i p(e ent t-ese speci+ications & *$itin, # testin, p$o,$a s. S'c- ana(&sts

    an% p$o,$a e$s 7no*a%a&s ca((e% so+t*a$e en,inee$s8 s-o'(% e +a i(ia$ *it- t-e +'((

    $an,e o+ capa i(ities p$o4i%e% & t-e DBMS to acco p(is- t-ei$ tas/s.

    DBMS peop(e e-in% t-e scenes *-o a$e inst$' enta( in a/in, t-e %ata ase s&ste

    a4ai(a (e to en% 'se$s 't not inte$este% in %ata ase as s'c- a$e ,i4en e(o*:

    D("* *ystem Designers and Implementers: T-e& a$e peop(e *-o %esi,n an% i p(e ent

    DBMS so+t*a$e. T-e& a$e not inte$este% in t-e %ata ase as s'c-.

    Tool De%elopers: T-e& a$e peop(e *-o %esi,n an% i p(e ent too(s an% so+t*a$e pac/a,es

    t-at +aci(itate %ata ase s&ste %esi,n an% 'se an% -e(p i p$o4e pe$+o$ ance. Too(s

    inc('%e pac/a,es +o$ %ata ase %esi,n pe$+o$ ance onito$in, nat'$a( (an,'a,e o$

    ,$ap-ica( inte$+aces p$otot&pin, si '(ation an% test %ata ,ene$ation.

    Operators and "aintenance 'ersonnel: T-e& a$e t-e s&ste a% inist$ation peop(e *-o a$e

    $esponsi (e +o$ t-e act'a( $'nnin, an% aintenance o+ t-e -a$%*a$e an% so+t*a$e

    en4i$on ent +o$ t-e %ata ase s&ste .

    11/20/2014 12

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    13/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    0)7 D1$S Co9.o&e&*

    T-e a'e$& !$ocesso$ Data 6i(es an% Data Dictiona$&. A (oc/ %ia,$a

    s-o*in, t-e inte$action o+ 4a$io's 'se$s *it- DBMS # its co ponents is ,i4en e(o*:

    11/20/2014 13

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    14/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    6i,. 1.= St$'ct'$e o+ a DBMS

    Da*a $a&ager= T-e %ata ana,e$ is t-e cent$a( so+t*a$e co ponent o+ t-e DBMS. "t is

    so eti es $e+e$$e% to as t-e %ata ase cont$o( s&ste . Data Mana,e$ con4e$ts t-e 'se$$e 'ests co in, 4ia 'e$& p$ocesso$ DDL co pi(e$ DML co pi(e$ o$ t-e canne%

    t$ansactions in an app(ication +$o t-e 'se$ s (o,ica( 4ie* to a p-&sica( +i(e s&ste . T-e

    %ata ana,e$ is $esponsi (e +o$ inte$+acin, *it- t-e +i(e s&ste on 'se$ s e-a(+. "n

    a%%ition en+o$cin, %ata consistenc& inte,$it& an% sec'$it& ac/'p an% $eco4e$&

    conc'$$enc& cont$o( etc. a$e a(so t-e +'nctions o+ Data Mana,e$.

    File $a&ager= T-e +i(e ana,e$ is $esponsi (e +o$ t-e st$'ct'$e o+ t-e +i(e an% ana,in,

    t-e +i(e space. "t (ocates t-e (oc/ containin, t-e $e 'i$e% $eco$% an% $e 'ests t-is (oc/

    +$o t-e %is/ ana,e$ an% $et'$ns t-e $e 'este% $eco$% to t-e %ata ana,e$. T-e +i(eana,e$ co'(% e t-e OS +i(e ana,e$ o$ a DBMS speci+ic +i(e ana,e$.

    Di > $a&ager= T-e %is/ ana,e$ is pa$t o+ t-e ope$atin, s&ste an% a(( p-&sica( inp't

    an% o'tp't ope$ations a$e pe$+o$ e% & it. T-e %is/ ana,e$ inte$+aces *it- t-e p-&sica(

    sto$a,e e%ia an% t$ans+e$s t-e (oc/ o$ pa,e $e 'este% & t-e +i(e ana,e$.

    11/20/2014 14

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    15/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    B%ery -roce or= T-e 'e$& p$ocesso$ is 'se% to inte$p$et t-e on(ine 'se$s 'e$& an%

    con4e$t it into an e++icient se$ies o+ ope$ations # sen% it to %ata ana,e$ +o$ e9ec'tion.

    T-e 'e$& p$ocesso$ 'ses t-e %ata %ictiona$& to +in% t-e st$'ct'$e o+ t-e $e(e4ant po$tion

    o+ t-e %ata ase an% 'ses t-is in+o$ ation in o%i+&in, t-e 'e$& an% p$epa$in, an opti a(

    p(an to access t-e %ata ase.

    Da*a File = T-e %ata +i(es contain t-e %ata po$tion o+ t-e %ata ase.

    Da*a Dic*io&ary= T-e in+o$ ation o+ %ata ase st$'ct'$e an% 'sa,e o+ %ata containe% in

    t-e %ata ase t-e eta%ata is aintaine% in a %ata %ictiona$&. T-e te$ s&ste cata(o,

    a(so %esc$i es t-is eta%ata. T-e %ata %ictiona$& sto$es in+o$ ation conce$nin, t-e

    e9te$na( concept'a( an% inte$na( (e4e(s o+ %ata ase. "t contains t-e so'$ce o+ eac- %ata

    +ie(% 4a('e t-e +$e 'enc& o+ its 'se an% an a'%it t$ai( a o't 'p%ates inc('%in, *-o an%

    *-en o+ eac- 'p%ate.

    T-e (oc/ %ia,$a e(o* s-o*s 4a$io's steps in %ata access:

    6i,. 1.3 Steps in Data Access

    A 'se$ s $e 'est +o$ %ata is $ecei4e% & t-e %ata ana,e$ *-ic- %ete$ ines t-e p-&sica(

    $eco$% $e 'i$e%. T-e %ecision as to *-ic- p-&sica( $eco$% is nee%e% is ta/en & $e+e$$in, to

    t-e %ata %ictiona$&. T-e %ata ana,e$ sen%s t-e $e 'est +o$ a speci+ic p-&sica( $eco$% to

    t-e +i(e ana,e$. T-e +i(e ana,e$ %eci%es *-ic- p-&sica( (oc/ o+ secon%a$& sto$a,e

    contains t-e $e 'i$e% $eco$% an% sen%s t-e $e 'est +o$ t-e app$op$iate (oc/ to t-e %is/

    ana,e$. T-e %is/ ana,e$ $et$ie4es t-e (oc/ an% sen%s it to t-e +i(e ana,e$ *-ic- in

    t'$n sen%s t-e $e 'i$e% $eco$% to t-e %ata ana,e$.

    0)" Da*a $o8el

    Data o%e(in, is t-e p$ocess o+ c$eatin, a (o,ica( $ep$esentation o+ t-e st$'ct'$e o+ t-e

    %ata ase. T-is is t-e ost i po$tant tas/ in %ata ase %e4e(op ent. A %ata o%e( is a

    p(an +o$ 'i(%in, a %ata ase. T-e o%e( $ep$esents %ata concept'a((& t-e *a& t-e 'se$

    sees it $at-e$ t-an -o* co p'te$s sto$e it. Data o%e(s +oc's on $e 'i$e% %ata e(e ents

    11/20/2014 15

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    16/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    an% associations ost o+ten t-e& a$e e9p$esse% ,$ap-ica((& 'sin, entit&)$e(ations-ip

    %ia,$a s.

    A %ata o%e( is o$e ,ene$a(i e% an% a st$act t-an a %ata ase %esi,n. "t is easie$ to

    c-an,e a %ata o%e( t-an it is to c-an,e a %ata ase %esi,n so it is t-e app$op$iate p(ace

    to *o$/ t-$o',- concept'a( %ata ase p$o (e s.

    T-e +o'$ ost co on %ata o%e(s a$e: 7i8 ie$a$c-ica( o%e( 7ii8 Net*o$/ o%e( 7iii8

    Re(ationa( o%e( an% 7i48 O

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    17/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    asta,e o+ Space

    Ne*+or> $o8el= T-e net*o$/ o%e( is a %ata ase o%e( concei4e% as a +(e9i (e *a& o+

    $ep$esentin, o

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    18/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    E9.loyee I8 Fir * Na9e La * Na9e De.*) I80001 As-o/ S-eno& 01000= Bi

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    19/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    6i,. 1.@ T-$ee Sc-e a A$c-itect'$e

    E *er&al che9a :or % er

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    20/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    $e 'i$in, an& c-an,es in t-e sc-e a at ne9t -i,-e$ (e4e(. T*o t&pes o+ %ata in%epen%ence

    can e %e+ine%: Lo,ica( %ata in%epen%ence an% !-&sica( %ata in%epen%ence.

    Logical 8a*a i&8e.e&8e&ce is t-e capacit& to c-an,e t-e concept'a( sc-e a *it-o't

    -a4in, to c-an,e e9te$na( sc-e as o$ app(ication p$o,$a s. e a& c-an,e t-e

    concept'a( sc-e a to e9pan% t-e %ata ase 7 & a%%in, a ne* $eco$% t&pe o$ a ne* %ata

    ite in an e9istin, $eco$% t&pe8 o$ to $e%'ce t-e %ata ase 7 & $e o4in, a $eco$% t&pe o$

    %ata ite 8 *it-o't a++ectin, t-e e9te$na( sc-e as an% app(ication p$o,$a s. "n case o+

    $e o4in, a $eco$% t&pe o$ %ata ite t-e e9te$na( sc-e as t-at $e+e$ on(& to t-e

    $e ainin, %ata s-o'(% not e a++ecte%. On(& t-e 4ie* %e+inition an% t-e appin,s nee% e

    c-an,e% in a DBMS t-at s'ppo$ts (o,ica( %ata in%epen%ence.

    -hy ical 8a*a i&8e.e&8e&ce is t-e capacit& to c-an,e t-e inte$na( sc-e a *it-o't

    -a4in, to c-an,e t-e concept'a( 7o$ e9te$na(8 sc-e as. C-an,es to t-e inte$na( sc-e aa& e nee%e% eca'se so e p-&sica( +i(es -a% to e $eo$,ani e% +o$ e9a p(e &

    c$eatin, a%%itiona( access st$'ct'$es to i p$o4e t-e pe$+o$ ance o+ $et$ie4a( o$ 'p%ate.

    "+ t-e sa e %ata as e+o$e $e ains in t-e %ata ase *e s-o'(% not -a4e to c-an,e t-e

    concept'a( sc-e a. 6o$ e.,.: e nee% not c-an,e t-e >'e$& to $et$ie4e a st'%ent

    p$o,$ess $epo$t e4en t-o',- t-e DBMS ta/e a ne* et-o% to sto$e t-e st'%ent $eco$%.

    0)00 E&*i*y Rela*io& hi. $o8el

    T-is is ase% on t-e pe$ception o+ t-e $ea( *o$(% t-at consists o+ a co((ection o+ asic

    o

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    21/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    Dia on%s o4a(s an% $ectan,(es a$e (a e(e%. T-e t&pe o+ $e(ations-ip e9istin,

    et*een t-e entities is $ep$esente% & ,i4in, t-e ca$%ina(it& o+ t-e $e(ations-ip on

    t-e (ine

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    22/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    6i,. 1. Rep$esentation o+ Re(ations-ip

    E,. St'%ent ta (e *i(( -a4e t*o att$i 'tes St'%ent "% an% Na e. Si i(a$(& Co'$se ta (e *i((

    -a4e t*o att$i 'tes Co'$se an% Depa$t ent.

    Di++e$ent t&pes o+ /e&s +o$ entit& sets a$e S'pe$ /e& Can%i%ate /e& an% !$i a$& /e&.

    S%.er >ey is a set o+ att$i 'tes t-at ta/en co((ecti4e(& to 'ni 'e(& i%enti+& an entit& in

    t-e entit& set. 6o$ e,: t-e social0security0no att$i 'te o+ t-e entit& set e p(o&ee is

    s'++icient to %istin,'is- one e p(o&ee entit& +$o anot-e$. T-'s social0security0no is a

    s'pe$/e& +o$ t-e entit& set e p(o&ee.

    Ca&8i8a*e >ey : S'pe$/e&s *it- ini a( s' set is /no*n as t-e can%i%ate /e&. 6o$ e,: it

    is possi (e to co ine t-e att$i 'tes employee0id 1 organi ation0name to +o$ a

    s'pe$/e&. B't t-e social0security0no is s'++icient to %istin,'is- t-e t*o e p(o&ees. T-'s

    social0security0no is a can%i%ate /e&.

    -ri9ary >ey is 'se% to %enote t-e can%i%ate /e& t-at is c-osen & t-e %ata ase %esi,ne$

    to i%enti+& an entit& +$o an entit& set.

    A /e& 7s'pe$ can%i%ate an% p$i a$&8 is a p$ope$t& o+ t-e entit& set $at-e$ t-an t-e

    in%i4i%'a( entities.

    A Foreig& >ey in an entit& set is a set o+ att$i 'tes t-at $e+e$ to a 'ni 'e entit& in anot-e$

    entit& set.

    Rela*io& hi. = An association a on, entities is ca((e% a $e(ations-ip. A co((ection o+

    $e(ations-ips o+ t-e sa e t&pe is ca((e% a rela*io& hi. e* . A $e(ations-ip is a ina$&

    11/20/2014 22

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    23/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    $e(ations-ip i+ t-e n' e$ o+ entit& sets in4o(4e% in t-e $e(ations-ip is t*o. A $e(ations-ip

    t-at in4o(4es N entit& sets is ca((e% an N)a$& $e(ations-ip. 6o$ e9a p(e i+ a $e(ations-ip

    in4o(4es t-$ee entit& sets it is ca((e% a te$na$& $e(ations-ip. T-e $e(ations-ip En$o(( ent in

    t-e a o4e ER %ia,$a is an e9a p(e o+ a ina$& $e(ations-ip in4o(4in, t*o %istinct entit&

    sets. o*e4e$ t-e entities nee% not e +$o %istinct entit& sets. N' e$ o+ entities to

    *-ic- anot-e$ entit& t-at can e associate% is ca((e% car8i&ali*y o+ t-e $e(ations-ip *-ic-

    is $ep$esente% & M:N in t-e a o4e %ia,$a .

    Di++e$ent t&pes o+ ca$%ina(ities possi (e a$e:

    a8 One : One 71:18 ) An entit& in set A is associate% *it- at ost one entit& in set B

    an% an entit& in set B is associate% *it- at ost one entit& in set A.

    8 One : Man& 71: M8 ) An entit& in set A is associate% *it- an& n' e$ o+ entities in

    set B an% an entit& in set B is associate% *it- at ost one entit& in set A.

    c8 Man& : One 7M:18 ) An entit& in set A is associate% *it- at ost one entit& in set Ban% an entit& in set B is associate% *it- an& n' e$ o+ entities in set A.

    %8 Man& : Man& 7M:N8 ) An entit& in set A is associate% *it- an& n' e$ o+ entities in

    set B an% an entit& in set B is associate% *it- an& n' e$ o+ entities in set A.

    E9a p(es o+ %i++e$ent t&pes o+ ca$%ina(ities:

    LINK T-is is a 0:0 optiona( $e(ations-ip asica((& statin, t-at a pe$son can occ'p& onepa$/in, space t-at " %on t nee% a pe$son to -a4e a space an% " %on t nee% a space to

    -a4e a pe$son. A(t-o',- t-e concept is +ai$(& si p(e a %ata ase can t e9p$ess it %i$ect(&.

    Yo' *o'(% nee% to no inate one entit& to eco e t-e %o inant ta (e an% 'se t$i,,e$s o$

    p$o,$a s to (i it t-e n' e$ o+ $e(ate% $eco$%s in t-e ot-e$ ta (e.

    S%/Ty.e T-is is a 1:0 $e(ations-ipH optiona( on(& on one si%e. T-is *o'(% in%icate t-at a

    pe$son i,-t e a p$o,$a e$ 't a p$o,$a e$ 9% * e a pe$son. "t is ass' e% t-att-e an%ato$& si%e o+ t-e $e(ations-ip is t-e %o inant. A,ain t$i,,e$s o$ p$o,$a s 'st

    e 'se% to cont$o( t-e %ata ase.

    11/20/2014 23

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    24/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    -hy ical Seg9e&* T-is is a 1:1 an%ato$& $e(ations-ip an% %e onst$ates a

    se, entation %eno$ a(i ation. A pe$son 'st -a4e one an% on(& one DNA patte$n an%

    t-at patte$n 'st app(& to one an% on(& one pe$son. T-is is %i++ic'(t to i p(e ent in a

    %ata ase since %ec(a$ati4e $e+e$entia( inte,$it& *i(( ,et ca',-t in a PC-ic/en an% t-e E,,P

    sit'ation. Basica((& t-is is a sin,(e entit&.

    -o e io& T-is is a 0:M 7 e$o to an&8 optiona( $e(ations-ip in%icatin, t-at a pe$son

    i,-t -a4e no p-one one p-one o$ (ots o+ p-ones an% t-at a p-one i,-t e 'n)o*ne%

    't can on(& e o*ne% & a a9i ' o+ one pe$son. T-is is i p(e ente% in a %ata ase asa n'((a (e +o$ei,n /e& co(' n in t-e p-one ta (e t-at $e+e$ences t-e pe$son ta (e.

    Chil8 T-is is a 1:M an%ato$& $e(ations-ip t-e ost co on one seen in %ata ases. A

    pe$son i,-t e a e e$ o$ i,-t not 't co'(% e +o'n% '(tip(e ti es 7i+ t-e e e$

    entit& $ep$esents e e$s-ip in '(tip(e c(' s +o$ instance8. A e e$ 'st e a

    pe$son no 'estions as/e%. T-e +o$ei,n /e& in t-e e e$ ta (e *o'(% e an%ato$& o$

    not)n'((.

    Charac*eri *ic T-is is a 0:M $e(ations-ip t-at is an%ato$& on t-e an& si%e. "t in%icates

    t-at a pe$son 'st -a4e at (east one na e 't possi (& an& na es an% t-at a na e

    i,-t e assi,ne% to a pe$son 7 i,-t not8 't at ost to one pe$son. "n a %ata ase &o'

    *o'(% -a4e t-e t-e na e ta (e *it- a n'((a (e +o$ei,n /e& to t-e pe$son ta (e an% t$i,,e$s

    o$ p$o,$a s to +o$ce a pe$son to -a4e at (east one na e.

    -ara8o T-is is a 1:M $e(ations-ip an%ato$& on ot- si%es. As *it- t-e p-&sica( se, ent

    sit'ation t-e PC-ic/en an% t-e E,,P is in4o(4e% since &o' -a4e to -a4e a pe$son to -a4e

    citi ens-ip 't citi ens-ip to -a4e a pe$son.

    11/20/2014 24

  • 8/10/2019 rt503_dbms_module1__2 MG UNIVERSITY

    25/25

    RT503 DBMS Mo%'(e 1)DBMS Basic Concepts

    A ocia*io& T-is is a M:M 7 an& to an&8 optiona( $e(ations-ip. Concept'a((& it eans

    t-at a pe$son i,-t o$ i,-t not *o$/ +o$ an e p(o&e$ 't co'(% ce$tain(& oon(i,-t +o$

    '(tip(e co panies. An e p(o&e$ i,-t -a4e no e p(o&ees 't co'(% -a4e an& n' e$ o+

    t-e . A,ain not -a$% to 4is'a(i e 't -a$% to i p(e ent. Most so('tions o+ t-is sit'ation

    in4o(4e c$eatin, a t-i$% PAssociati4e Entit&P to $eso(4e t-e M:M into t*o 0:M $e(ations-ips.

    T-is i,-t e an entit& ca((e% e p(o&ee eca'se it %oes (in/ t-e pe$son to t-e e p(o&e$

    t-e pe$son *o$/s +o$.

    A $e(ations-ip in an ER)%ia,$a *i(( a(so e $ep$esente% & a ta (e in a %ata ase *-ic-

    contains t-e p$i a$& /e&s o+ a(( entit& sets in4o(4e% in t-e $e(ations-ip a(on, *it- t-e

    att$i 'tes o+ t-e $e(ations-ip. E,. T-e En$o(( ent ta (e *i(( -a4e t-e p$i a$& /e&s o+

    St'%ent # Co'$se ta (e St'%ent "% an% Co'$se $especti4e(& a(on, *it- its o*n

    att$i 'tes Yea$ an% Se este$.