You are on page 1of 8
MODULE 4 The Entity Relational Mode! “The Enlty/Relatonship model is represented ofa rea-warld composed of objets called ‘entities. How an objec is ralated to other objects and wce-ersa is datined i ast of rules called relationships. The Entty-Reltonchip (ER) modsl was developed in 1976 by Feter PirShan Chen, ER is 2 highevel dats model that i useful in developing a conceptual design fora database, The sjstem design and programming make use of flowcharts, and database design makes uso of F/R mode. Also, both are graphical representations in the sense that they both make use of aferent ses of symbo's. Below are the symbols used in E/R modeling. ENTITY/ RELATIONSHIP (ER) DIAGRAMS ‘an EfR dlagram 1s one means of graphically expressing the lagal structure of a database, Jute fouchatng thas ts onn set of symbol with predafines uses and meanings Rectangle “This symbol repesnts entity ses. A double cactangle f usd to represent weak ents, Ellipse “This symbol represents props or trues. A dted lief sed ta represen a served attribute, ea double aise i sed to represent multivalued attbules. 1f an atbuta Is compost, Rs ens are desurbed as separate (and usualy smal) tlises connected by a lin tothe elise containing the composite atitute. To represent hay atta, ts nae is nderined Diamond “This synol represens eatonships. diamond is doulled i the reainship is between awk entity type and heey type to wich is estence depends Line This symbol is used to connect attrbvtes to ety sts and vices Lines ar abled “1 or" to ntcte whether the rlatonshp fs oneto-one!, one-to-many! "many- to-ene', and man to-man!. & double nef usd orapresent otal patspatin of 2 rartpant erty in rebtinship. Rules for Drawing an E-R Diagram Detittone: Examples: ety onatia ouch Ore mt athe tema scrote nest * ® fehimaie swwsncitontewees sty tpe «em lenin haters etn 7 <> tecond snarled stot site aes INaGeeeieonirtnceotan e995 Oycor gre Av we emit whore ore Symbels: moO ose Ab encdeta thc <> microti att nant FOr c= pat opts ascision feat a PL Coven toate wenn Barone bt eS — ‘nivel chive aescaton OLS ENTITIES: ‘entity isan obec hat ocars and is urigue ftom other objets. For eam a cata name Sofa Lu ith employee rumber 20-0103, = an entity becouse it dsingushes one pacar employee. An entity may be used to represent concrete objects auch 353 parscn cra beck ort may be usd to rapresant abstract objects such asa pescscullsatis nites have struts: sample: Employees hve nares and addresses Wihen ene ofthe same bpe are grouped tngether, an entity se is formed, For ‘example, F we goup Sots La with other employes with unique enployee srs of tele cue then an entity set is formed Our sample ety set can be called as EMPLOYEE. EMPLOYEE RELATIONSHIP. | relationship are assocltons among several ets, For example, we can deine ralatonchip WORK, which reprzents cfuaton wharan employees of 2 partelar company wnt under 2 partcular dopsrenant Eaten tie rstoahip wa can =ey that Sofa Luis under the Farce department enty. Rotem nolan forreltershp yee works [Eten ond ebenships can be deserted in frm ofthe propetics that they possess. For maample, all nzancar of tha ENBLOVES entity can hive atta bho employee umber, ner, designation aelery among ches. The demain of = propery i oad fo etn the rango of secepinble values it ean contin, PPE ‘Simo or Composite Single oF Multivalued Const atts cent ves wich can be fra sve tn sae unts. | Atbibutes that can havea zingls value at = porter inctancs of ts ae called sinals- fn eximple of = composts sropary canbe an enpyecs name Eecure cn be [pf alisd. A person cannot ave more then one age valu. Therefore the age of «person ried its Bit ame, mile name i leat nares 1 singlewaluad sttibute. An atnbute that haz mora than one valua stone tina ie QOO Called @ muitevaled atubute, For example, the degree of 2 person a mutvalued tities person cn fave mere thn ene ee, QPPE anew ER digram norton for mult-valuad atrbute domain, ree Key 1 key atte conti 2 vave that con be used to unl ides 2 spechc Instance withn an erty set, For carpe, the employee number atiouts cn nivel erty 2 pac erpoye stance ike Sta i. Soy aa) ‘Stored, coded, or denved attnbutes ‘There could bea case when S00 or mere atibuis values are comaced. Ecarole of a derived attribute the age of: perzon car be calaistd from persona dts f birth and the pravent dat, Derive attributes are usualy generated using a formula, | PERSON ER diagram notation for deved atbibute, aoe, [Stored attribute determines the value of an attbite from hich anether stitute value, the date of bth an ecarple ofa stored strbute -Acaded value uses ane er mare laters er rumbars io eeprsant 2 fark. For aca, the vale Gender might use the letter "N" and F” as values rather than “Male and “Female ‘SUBTYPES AND SUPERTYPES [ican be si tht any given enty is oft east one eny type; but an eny canbe of several types atthe sae time, Fr example some ofthe student in the erty set STUDENTS ae mars ofthe shoo chi th ety set CHOIR (wich means that al cor members are students), then it can be sai thatenty CHOIR sa sbtpe of the supertype ently STUDENTS. Subtypes cn tave subtypes of ther ou, Fr instance, the subtype CHOIR may have 2 SOLOIST and INSTRUMENTALISTS subtypes. ‘exiaanadcemeas DD GD Po eased) Co) Gaui) oe) GS) aon er r EXAMPLE 1: £/8 DIAGRAMS EXAMPLE 2: E/R DIAGRAMS ER Digrams with Role Indicators EIR Diagram with Weak Entity and Relationship supervisor wee welt represent bo stipes ith sipetipe EMPLOYEES, In atone have aed an "Hon he oto ne and 2" onthe ep. Tiss ‘hata manpo-one btn xs beeen fcr and nomics, pectic that RELATIONSHIP You Gn use ER DuaNs to nda Ts payee by deren subypes tn 2 Gawd) Grou) GEE ee) Goan ptr ep, Rls a inked by cg te ns tht come tiesto tdi. In the long eam, te lends abode ad . é : mary subordinate eas von supers rhe next example shows a model that contans 2 weak relationship and erty set. 1" ie example, PAYMENT represents a weak ently set wth attbutes Fran Tone JPAYMERTT_NUMBER, DATE, and AMOUNT. On the other hand, LOAN_PAYMENT aD represents a weak relationship. This diagram showe that weak entty weak set ad PAYMENT ic degendent on the entty set LOAN via the telatenship sat Teme LOAN PAYMENT. chtty PAYMENT ic weak because its existence depends on the Joxstence of LOAN. For example, f we remove entity set LOAN, then the PAYMENT Came) ery vt wat ane bx fanved cite tout ap acne te woud be me peer. natn thy te latcipLOMM_ PATIENT ro weak Beco a See Jt ts dependent on the existence of the weak entty PAYMENT. For example, It Is Furtovee posable that an exeting LOAN wil not have any PAYMENT and the relationship LOAM_PAYMENT wil not old true a6 2 matter of conssquance, Ite this regard nat an enky S8t Uke LOAN can exit without 2 weak entity PAYMENT and a wank tations set LOAN_PAYMENT. EIR Diagram with Aggregation ‘© 16 used when we have to mace a relationship imlung(enany sts and) 3 laonstip st ™ 4 Aagceaaton 6 2 proces won 3 rlton between te exes i watad 3s 1 a singlet Example: Am employee ith atibute empna and empname can werk on ony one projet ith atrbutespojno and projmame but tere might have several workers in one projec. every ume an GREAREIMERRTERTETPPORE he wil be assgn 2 corn ‘equpmant anid by equpro and descapon.

You might also like