You are on page 1of 41
ereneee Learning Objectives ing oe Chapter 5 Data Modeling and Database Design m4 eri ConcepaalPeundason of Accovstng norasion Ses INTRODUCTION Like many companies, SES is converting to che databose approsch fr Korine a ey ts caper, you wil lear How desig and documens 4 2 accounting Sa aecountng infomation te You wi ss tha hee #5) Sonal dans; gnaase tan simply ieaaig the tas of Dow ts Pah ao ae curate databases requires 2 great deal of carefl planning sed eng Bef even sit down at he compute St ser on dat odcing, oe pect of database derigy, cc ene anderstand, We induce dhe REA accountng model and eo account ey agar a sh hw 9 se thee elt Dd ta oS scan ib how to implemen he reslng data mode in eon 3 AS Tre Manin, bowen that altough out discon Forms om ronal daa ences appl 0 bulng any spe of database DATABASE DESIGN PROCESS Fire shove gb eps ndasbase di The St Ss coms SS Fe terme actor anf oder eT ee Fare ry judges abou the propel’ eclogl za coos Sets a es eting ns infermasion Peed dig tops aa ey new en and wing noain about he expen ES SS ofthe prope resto help you make preliminary decison ost EGNOS aad section Tina The id age incdesdeeoping the dere! chest “es concep ener a itera lo, Te fur as ee eral! che inode acl Gta roure hs Sort ine aoe sen. Thin abo he age veh or ‘era plemetnon Hage ines a he aces asoied Wh tT ters one danse AIS esing ie new tns A04 E a soe The Gia og ares sigan mamaning soy TE Fee chy monitoring Her prfoanance and wer sacle Coe Fa ping see eaancement 0d modiaons Eventually sh mn ee eran races sigan new deveopenens information aa eign re easly of developing ane sm and ore ae ars agin (ote he row ecacing tbe SNE AEE Sa eis sald pargte in aagevot he dab es Done nn a a ci parpaon nec geil any Tn Ps stout fe bmn prove ae of the infomation wel eae en ony earcate malig that econ. In he requenes? ce sng arcana aia Menng serine oe ara See ohn desging Ue dat csoney nd eine deco she f lala ay pat the couing wage, Duting Ie SEN Account Esta on bees the cerey ofthe new dais 20 OS sa gansta wl ne ta at Folyaccounens the as a8 serbeaion Rms, and somcimestbeyeren lp ange ccs tae rade dhe greaten value to their organizations by SOE cope orm nosing Dasa pode’ he procs of ein ee te Chapter 5 = Data Modeling and Database Design ome, ing Objectives: After studying this chapter, you shouldbe able to: bisa he steps for designing and implementing» dathate nse, 1 eth REA data mel wo design a A danse 1 Drawan enyrettiothip (ER) aagram of m AIS datas builds seo aie timplemencan REA mode ofan AIS ina elation! dca bt Rex an ER agra and explain win it eealesout the busines acivies and pole of he ‘rganzation being modeled Integrative Case: S&S, In. ‘Aston Feng urate. He sang af commute whe cones out the {ered ctr of S55 pe nee Ss The conse bg hen ts fables and ab ‘Secwitb ode ia be nam but aceon nt creche propeed aig cy met S8Se nwt, “Whe raling ov ston Aco bp 2 sare rough i tk of ma a he ‘cen his ste CPA soc Sear. sneing aut is etn ye SMRERE o- al dag tl ent weak = onto hal The Shine’ elec et ee ancora tw to csgn areata ined how cher his rds aed oe ave ht Sea Suan Oe bette houpt he sri ould provi (SuStan aye to snd ‘hen Ropes solar rors fo the folowing quetdons by teed of te sein 1. Wacare the ts step fol when desing ate 21 Wun corny sean tc haw ey a you dee wth abe bong n valk ite 2, Howson you dcumens an AS ht naman 2 eon date oe us ua purr Concept Foundaon of Accounting nfonaton Sant INTRODUCTION ke many companies, SKS converting the databag peranc fr Sore Like many conP ths chapter You wil ears how t design and docameny ST accounting a ean foram stn. You wi ee tnt ere 6 Sonal daa fF Sabaneta spy earings of om 03 PSS ae ace database reuies eat deal of ae pasing a8 page leu cven it down atthe compute feo eon dia modeling, aspect of database di Ot mee eerstand, We inoue the REA acouning mode an6 7 coun gr a shh 0 se tee oD aa relat (ER) Siew to spleen ie teviing daa noel in oe) A Te ind, hones, that although our discon foce rons daar procples app o bing ay pe of databse DATABASE DESIGN PROCESS igre 51 shows sata design. The fst stage cons of nil i sce need ora est £ GVO Thismage paning to der emer ako he propor’ techie 28d oe | Shee} Ss] Figure 5-2 Sample ER diagrams Asshown in igure 52.E-R dlagrams can inelude many diferent kindof entitles sand seatonships among thote ents. An important sep In database design, there dove enue deiding which entities need tobe modeled, The REA data model i use- fal for making that decison ‘THE REA DATA MODEL Specifically used for AIS database design, the REA data models a conceptaal model ig tool chat focuses on he business semantics underlying an organization's value “Gin actviier™ The REA cata model provides guldance fr database design by iden ing what enises should be included in de ATS database and by prescribing how to ‘ouete relationships among dhe ents in tha database. ‘Types of Entities ‘The REA dta model clasts entities into three ditoct categories: the resoures the ‘igunieadon sequires and wses, the events (business acti) in which the organiza Sipe isco dap Ho lin ary de Entel iw Se en ee facamiog mgt na Eeamt”T serena ly 19%}: S4-894 a8 Cada L Onrn dW. Mariya Oates Ana CE ae aye esata terrains cece Pang Th a Genet Spt onary 18,50 Seta Ana) ReurrotDas Modeling and DatbaeeDesgn TUT Figure $3. Sample REA dagram ion engages andthe agents paricipating in these events Figure 58 provides exam pesos these ens. rane care hou things hat hae economic value othe ongenizaion. fa Figure sS.cnh and inventory ave resource enties Machinery and equipment supplies, ware To Shores and land are amples of oder commen orgasinatonal resources. “cca ac tne various business aces sbout which management wants tocol tect information for planning ar control parposes* There are wo event entices Figure snes and cash recep, ‘The MEA dats model hen people design databases that suppor the manager ment ofan organization's Yale chai scvites. Therefore, most of te events in REA data model fal ino one of two categories: economic exchanges or commit Be eosonie exchanges are the vale chat actiies that dec affect he saat y of remerces For example, the tals vent decrees the quantity of inven aie dhe eh receipt event increases the amowst of cash. Commitment repre en omer eo engage in futuce economic exchanges. For example, customer edo are commigments that lead to future sls. Often such commitments are nee SISSY precursors co the subnequent economic exchange. Moreover, management Serom yecoicarermrtenemaenatamiense OS eatin aera et arm Seaton Arhanes Se nad Wart Os arrcce ‘eye munya br foci 118 Paurt__Conceposl Foundations a Accounting Information Ses ‘needs to track commitments for planning purposes. For example, manufacturing firms often use information from customer orders to plan prediction ‘Agents ae the third ype of ent in dhe REA model. Agents are she people an ‘organimcions that participate in event and about whom information ls desired for planning, contol, and enluation purposes, Figure 53 clider wo pes of gent ent Ses employes (Salesperson and easher) and eastomen Supplies (ot vendor) aze another ype of agent that woul sppearin an REA diagram of the expenditure cle Basic REA Template ‘The REA data model prescribes abasic pattern for how the three qypes of enties (cesources, events ad agents) should relate to one another Figure 54 presents this ‘base pattem Buch event enti ielinked ta reource endty Events such tthe ele of| merchandise, that change the quantiy of «resource are inked t that resource kn ‘iat ie called stockfiow relationship. Other evens, sucha aking a contomer order, {hat represent future commitments are inked to rexources in what are ealed revere relationships, Each event enty ie alo linked to two agent entides. The intemal agent iethe employee who i rexponsble forthe resource afeted by that ven the exter agent isthe ouside part to he eanscton, "Figure 5-4 also shows that each economic exchange events linked in agveto- set duallty reinconslp with another economic exchange event. The econome ds Fy elatonshipa reflect the basic busine principe that organizations pally engage Pn “Figre 5-4. Basic REA vemplate See ge fo Fe) Wn cary To EA Ang Ma A Cait Fame cnn ‘Siete SaecSae tna” Panag ae uy S86 td gr phe Ca aan hay Tacha a acl ering an rope ep a ies ms pg eB, Don Modelingand Daub Design tiv actites that we up resontces ony inthe hopes of acquiring some oer resource inane For example, the sales event, which requires giving up (eerewsing) a oacpa i retted ta te anh vecepes event which requires geting (increwsing) che Het cac, Teed, Figure 4 shows tha! each ecounting cle ean be described Ms ob uch givetoget economic daality relationships Fairer n8 Ghrough show tat the REA dats model ca be depicted sing ER tings he remainder ofthis chapter ad chrongons the bok, we wl refer to santrtram develnpes according the REA data model asan REA eagan. Let itaow explain how to develop an REA dagram. DEVELOPING AN REA DIAGRAM. FOR ONE TRANSACTION CYCLE Fagor 5Sshows the REA diagram Aston developed for S&S's revenue yee. This wo iaicplats how to develop sucha dlgram- Keep in mind that Figure 38 models aoe eeaet ofall S&S hurnestatvines To design an entire AIS for SES. Ashton or ly needa to farther enhance this Basic ssodel, but must ako develop similar elie for SkSs other transaction eles and then integrate those separate diagrams in an enterprise model Developing an REA diagram for a apeifieransaction cyte consist of the fob Toning four sep dee i of ono tg ee tp a eth Tenly te resoures affected by each economic exchange event and the agents who Rie ach eee exchange event to determine whether tahoe decomposed pone saan af one ature comme even an an economic eChSOge ree memes replace te orignal ecoome eachange event with he resng et ‘Teoma and economic exchange v= 4 Determine he carnal eek reais {tut flow these Four steps i see how Ashton developed Figure 5-6 to model S's vevenve cyl Step 1: Identify Economic Exchange Events Figuce 54 shows that the basic REA template consists of par of eventsone chat inteases snme resnuiee and one that eecreases some resource. The basi eto Hn exchange m the reneoue cycle involves the sale of goods or services and the ‘Miequont recip of eas i payment for those ale, That, Ashton begins drawing The REA diagram for S&S's eevemue cycle by creating the sales and cash receipts eats ents a rectangles, and the economic duality relationship berwees cher swadiamond Te yeating an REA diagram for an individual transaction cycle, tis use to vide the paper int thee columns, ane foreach sype of enti. Use dhe lef column for resouneee the center coluran for events, and the right column for agents Readability i farther enhanced i the event entiles are drawn from top to bottom 19 Figure 5-5 AnAIS viewed ata set of gveen| coe ] [em fom = | Ler Figure 5-6 REA dagram for SBS revenue cycle corresponding to the sequence in which they eccur, Thus, Ashton begins to dra Fa ty showing che aes event en above theca receipts event enn dhe centr column af the paper? Step 2: Identify Resources and Agents ‘nce the events of interest have been specie, the resources that ae affected by five events need tobe identified, To cootinue our example, Ashton observed that esses meat carats to giving inventory to customers and that the cash reelps® RTS ssites to weceivng eash from eutomers. Therefore, he added the inventory Sey aRtes in ie resources column and drew the soekfiow relationships Ieween those ens and the events tht affected them. “Wht about accounts recenable? Accounts receivable isnot modeled ns 3 seps ove enty becatne ts notan independent object, but simply represenss ning i Terence between to evens talesand eash receipts That's accounts receivable spy ‘presen sales for which customer payments have not yet been received (cagseendy, i data about both sles and cash collections are aready tored Inthe 122 paxrt Concept Foondains of Accounting Information Sem database al he information needed to calculate account receivable can be derived Fe ne information wored about duos feo evens, Later in tis chapter we wil ein how w exact information sbout accounts recehable from an AIS database Dall using the REA data model TR specifying the exources fected by each event itt neceay to deny athe agent who parsepat in those evens, There wil alway be atlas one internal sree eingapes) and in most ete, an exeral agent (ostomer of vendor) who sequin each cent Lathe cine of SAS eve cyte, customer and lxpe cary purdcipnc in the sales event Cstomers and the cashier paricpate nthe cash ‘ete event Thus, Ashton included tree agent ents i the REA diagram of Bes Gave cytes salespersons, casomers and cashiers. He then added relation Sepsis indice which agents pardpatd in which events. To reduce chute, he did tot daw multiple copies of the casiomer eaiy® ‘tu imporant to understand that the agents in an REA data model represent Jancis notepece people. Ths, in Figure 86, Aston modeled bod the salespe Fen ee cr agents a teparateentes Ite ponsble, however that theme perion aati bot roles, For example in a cash sale, the salesperson alo may ato the a trand collect payment fom the costomer The REA diagram would sll include two agents o model this station, howeres. Seis? ouon considered whelher he needed to add any other seats of snveres betucen entities, The REA model reqlres that each event be Tinked to teas areerSuree and to atleast two agents, Thi information needs to be supplemented ‘nero with aanagerent to deny other posble relationship of interest For Caeple fe organization asigs cuxomer to ape slemeoplet provide cu ca Mice tena iret relationship betwen the wo agent eis (salesperson roe taner) would be aed tothe diagram. Ashton decided that he di not need seiiehade say bach relatonship for SES. At this point, his REA dlagram for tbe re hue cele looked Hike Figure 8 step 3: Include Commitment Events The third step in drawing an REA diagrams analying each economic exchange event Ta nemine whether inean be decompored ito a combination of one or Bore com TBhament and exchange events. Although Figure 59 accurately models SAS’ eles carrera who come to ie store, Adon Knows that S&S alo receives onder fom canommers dice way: ever the Internet, by phone, and by mail. Is important dat eerie upurdate information about these ores 30 that Scott and Susan Seems to seonder various imentory items. Ttis abo important to know which itis hae been shipped and when, Therefore, Ashion decides sa xepace the sngle cree yirtachange crent labeled soi in igure 5S wid the combination of com FREES aiila ie labels ater ors adhe ecopomic exchange ew STE Toop he abe ss hon devas that the tales event ean De wed to rep ca Rat shipmctir and fedtore sles, becrore SES cllet almos denial infor aasne about bath yper of sales The primary diference beoween the oo events {Gat instore sles wil not have any shipping document number. ————__”™”™—~S—s—‘ 4} ck. | adn ny AD np pa eo | Figure 5-7. Diferene types of relationships tomakeamumber of purchases during period ote (eg. amonth) and then pay oF ‘hse prchate with one payment Figen 5:, Panel D depiets manpcomany (MN) relationship between the sles and receipt event: Fach sales event may be inked one amor cash receipt BRohw and\caeh cash receipt erent may be linked to on or marsales events This jee aleation in which the erganieaton makes some cash ales, rakes some sale that eustomers pay for in insalnent, and allows customers to pay for more than one ‘le with angle Femsitance TGtdon Do not conkas the notation wed fox niin and maxim car Cinaltes (2 pat of umber separated by 2 comma) withthe notation used Ao dete the cardinality of relasonship beosen two entities (a pai of rated bya olen). 135 amc Concept Foundations of Accom secesor peut! “The database dexigner does not arity choose codinalien, Instend,eardinalies refit faci about the onznizaton being iedund i bosines practice. Thi nfonaaion i obtained during The requis. yeah database design proces. Thos Ashton i to ear aan arora comin conducts busine activist ensure that Figure 5 was eer us. Conan general principles, however, an preside a tarsing point for Toluplngan REA data model for any organization ‘Caudinai rules for agent-event relationships Gest gare 2 the inimmand mavanum cardinals aocated wth dhe aaa as ery agentevent reatioship are both one (1). Tiss mot aay See The minima eardnliy asocnted withthe event ei is} becuse dere apo abo partite nha evn For example, ales eat mus Be oe eS The aun cardinal usally so 1, beease the organize a abe ale ta held some specific agent responsible fr that event. To con TES ine previous example, a ale made to sone specific iensfable cisomer who cee sew pay frau. Saar oasign credit tothe appropri exploye, error n cardinality of the evest ety a selationships wits internal agents (¢ {br tne ales evens, a sleipercon) ie lio usa 1 Trae Sue general principle concerning the cardnaitesasocated wits ane agent ea in agentevent relionships. Nodce dat in Figure dhe cardinal aa re ya Each agen in the agencevent relationships all have 2 mink ae ee N menue, This combination iraso quite pica, The maxisum card ri atecated with internal agent ends in ageatevent relationships is amost aan etce organizations expect tat thei= employees wil participate in aa pecans sally N for extemal agents, becase organizations often gag it repent cansaona withthe ane spin and estomert Thee a gage Pe Sana eardmabiy sociated wh agent csi i agente SSPE aly ero (OF geno wt beable a Tora SBOE un crore su sper ees. ah owe gers oa SE pe nay DRT ators vt ee ae aU a 0 ea ae ages omar Are eo ea oFeeen abes ae pal archived and te ne fea eo STS Ea by aig hat every agemevent reltosip could be He ee pteny Boe (2) TON Agent sit hen mere ea eesti acteznine wheter he teed to sneha asim ie were no exes ncalpracie e shne aa aretnatigy rates for resouree-eent relationships Rare Digure Bo he Me miniuu and masinur corinaliiss ae ere evoueeevent flan are zr () and Ny respectively. Tis ‘plea rea ongantnons for mnt eemuree, or Ube sme ess ge eal Cuarrn Dats Sodting and Dats Design 127 ven explaining the mpieal nina si sium cardinals swsuclated with juonts age ntevent seaionship. ‘One exception to thie general rae ig hat dhe roaximun cardinality asociated vi dhe nventry resmrce Rsonveliner one (1). Fiore 5 reflects the fet hat SES {Wis maseprentaced merchandise, Far each pe of lem case SRS mst know the oti aed wnt aay able For fle. The company sso must Know th ei of each item, bought or ald, SKS des not atempt to uc which speci thinset ws nladed in a gventpsiction however Consequent ach win the ingot tale in Fgue represen 3nd of em, Foy SRS the primary kev {fen manber Ofer organizations say ell de primary hey a part number oF SKU nse. The important thing to understand thts ro ia S&S’ inventory ble ‘ive inked any dilferen cows in the le abe ‘Soetines, however onganiauons do Wack specific physical inventory ites Suite samples clade orginal artwarh, vehicles, or house. For such merehandie, each ore a city Sem pscaa fp pinoy ore aa wo be oy eee ere rere sienpeaisd Dame insitveacegves (,{) “Tavern Se eve ont ai cold be stad wih sino oe teremmesonand, Seka wngy mul aves mation end of intend FN Non Cones the cardinal succited withthe event enn esoure-event ston Figure cells te general price that he minum eadialiy ied wih eventenies in esource event elatonabips stall. Fer example ‘cts cent but nelade tent one rom in he inventor table fra sew ou, NéStnstosc someting, Silay each payment cetved from a customer mst be Gp nto sone eh necount Te ony excepson to thi general ae ares a ‘Stn potently canbe linked to sore tan one resee enti. Coser an au Su tpal Bien Some sconces, such tre rxaonsmay nerd Saale ‘Ein part wberen Stier sepdces ni any bre rept inlude bh bor and fhe Faun theses event for such an mio Fepair Busnes could be Bed 0 ah lwony ently or to's tepair sence enti, oF t0 both pes of Fesourees. Csequenty Ure mini edna forte tals event woul be Din Bot of those feavonhipe (Note: tn ae sation, a event might be inked to one of several nique agent cies. Tn such cass the sinus carnal asaocated wth the sent ent again would be O instead of ie nenaal 1) “Thee ateno gene principles canceming the rasmu cardial asodlated ith centettiies in eanuneeeveitreltonaips, However bie i Vhndnaiy foray evar depends un te aatve ofthe anutce lesed peda sent {Tati the onmmation's buns polices For cep, Fre 50 shows that each SCS isTotlowing sound sine practcee sn depostng all eustomer payment ito ‘wae to special eset account) cots, Fie 5 shows thas exh ce eros aes event én be in ket rane inventory bl, Deatse Trot the dese Por capi xen eles sco might nce eth a $iinck monitor and phot-qulity primes Consequent fn Figire 4 the max sna ennai rb the aoe oes nes ents thee elanships - Pes eee er ce only one cash acim, This indicates chat 128 Park Concetn Foundation of Aceanog information Sent Cconsality ules for evers-event relationships Sean So ay nnd of eorib ai pesb or ih St Pigure 7 2 cerca. Te ongnians bs races an Pl: casi in even decide wich pony corre, Ao lnred Ua SE smite a nome and tai dem monthly samen tng 2) aps en eae eed tt manycntomert send SKS one checks oe 95 8 rc ga pene pe. Ts ne eash resins et ld UNS porches ent Si ao allover o make ealment snay ferent Se enna gen ren co be compte more St ments ne Peat sy Aubin modeled the eaontip Between these SRG aah receipt evens as being manyomany. umes derail and wa unl sts ae Hoek loaner Therefore, Aston modeled the elaonshp between ear Feien and ales events as being aneXOONE, ore ane oeling pipe hat appt Yo renee lane a Een dered ven he mine carnal fore fs een ae Pe aces te oer een ins ote maypeneds fen ts Oe um eardnaiyfortne en it happens second #1 nS es aban mini ve alent ocurred For example, for compan that) che fm evens Hal ahenalogor onthe Web, cstomer orders (est) Pred Sree met (eat 2 Seine Rome, of SST shipment le COTES feces oer rom corporate comers before 2B cat For ete ee tovain comers, ROWE, Dot prec ahem er pecquciy a igte ,e anrma eariaiy aac ih ae en cpus ip the cstrer orders relstonbip #2800. se at Ans REA agra SAS rene de oad eae aceon tus ran earinalis, The next ep ison eSicinis moda in rational diase IMPLEMENTING AN REA DIAGRAM INA RELATIONAL DATABASE ‘Once an REA dagrac hasbeen developed ican be sed dein wel sce oe i fac eating ate aes rom an REA Sagan SOMA relational Ge eared van database that snot subjec the update see sea ete snomaly problem ascused in Chapeer 4 eo nary an REA diagram i arelaonal Gnas a thcestep roe ‘Len table for each disney andor ach manptoeany rasp, 2. Ani aan o appropriate wes 2 igi to mementonewrone and ocesnsany snot step 1: Create Tables for Each Entity and MN Relationship cepa degned relaional daca asa al fo ach nlp cai 28 are ry tatoos an REA ding. I ne cate OSES reves aah mania epee aye soe din eno nnentor Bh, et OF ae ere employes aud castors, Alvough the REA diagram consis CE r= _™—_—— &8& 2} }=—. cura Dasa Medel jing and Daa Desig ‘Table $1 Facts to Be Stored in S8S's Revenve Cee Database me be Se | a cent ites ghey ca Seo mohecmee Sees | me | a gore separate entities fr the salesperson and the cashier, only one table, employees, i Hea crane Sus needs to know the idenial information about i salespeople 28S cashiers such an mame, date of Bt, date hited, and pay rate. ‘hare 56 abo depicts three MEN relationships (customer ordereinventoy sles invent sad eleventh receipts), Therefore, 10 tables are to be created co imple ae CREA diagram shown in Figure 86—one foreach ofthe seven distint eat ticjand one for each ofthe tree MEN reladonshis. tis good practice to gv each table the same mare a the eniy that repre sent Tables repesenting MIN relationships, however, ae often sed by hyphenating sneer of ee oo entis that are inked, Thus, in terms of Figure 56, we would cee aie Ses contooner ordersventory,slesimventory,and salercash receipts for ‘hee MN eladonsblps Step 2: Assign Attributes fo Bach Table The neat step isto determine which atzibates should be included in each table. During the dats modeling proces, users apd management will have identified fet that they want to collect Table Lite he fats hat Ashton knows are exental tothe flubase hei esigaing or SBS revenue ile 129 130 arr —Concepia Foundations of Accounting formation Se sin Rane primarytay—Forsqnters Other i my ken Souipion cree = wy slapenenth —Banmeanou ‘Sone njore Smee Numa Ter comer Cota nme | cut econ femme ge Nn Camere Sena “owe i utomerecen Oner ——CoemmthDat | rent i xternerary Ont ten nei on SiSeery” cea rerun, | acon | suincahrcoes e enti prouevris_—_ | igure $8. Tbe rated to plement REA diagram in Fre 6 sen Priory too Beery able in a reaonal database must havea primary se cai a abe, or combination of atsibae that amiguely Hen hey consi able Companies len create numeric senses for spect ch row ind agent There numeric Klentfiers are good caites re Fr compl S45 might ne vse amber 5h rar He A Primary ey Te Goomer mumber a the provary hej of the crstomer ab Sey amar ey fae representing an enti bang ails prima oruaNelanahip bie, Hower ae cn of wo aes i pry tee each uy Hoke in that ea, For Name Tepe Pine ecient we cons of both the ioe nane he Pr Fa efthe rales enti) and tem number (the 3 invent0rY en), Sash ul Perr iter besides the pray hey ae inl i cach ble os eanncton proresing RA the rina bt penton need Fgae ss the wits ha A aa an bse ete openers SES even cle REA aca ene nites uch asthe date idumoanteach ae Pence aa duce rnuconprosengand he proton nan) se ta tal reponse tues are ure cae they fete en of on organ esurees, ren and agents For amp cL rh": i © unr F~ Das Modeling Date Desig Seoit a Ses ea we daa about he tne whe each ale tanscton aca 0 de igo sta work sceden p tet us examine the placenen ane none ater each the MEN ales osc wy hey mute stored i these we arable Constr elev eceips BI Rei SS 8 rar poke nuipl purchases on credit to make iain payments ov tele a eg ahances Thus one estnser pament may needtobe appied oye die ea ues cin) These he abuse stuast-anped canoe ee onl anal aban Tat eer aT eeey ee etirement hat ce able bea ache), Norcia AS placed in the les ble, bea ti pas of allman par ie va therefore, belong the NEN table inking hose wo event. nine de slrnentory table Fach row nti ible contains information nut te nail, Aldoogh any of SKS asm Bay jst one of Ach aoe Mc ac ome esto comes inv reruns, Consent ag erent Une quay sold of each Hem. Each sales ev’ howe, may nce Ses Mune ventny tem This he ait qui 3” may have seer! ales ron ye vlc’ one foreach em ol Cosequenty "quant sald” not be 2 ni nese, bene there can be more than one “quantiy a” wok 2 ince moe tn adtdon, S45 els inet by Keds of tem ot eet Rca. Therefore «gen es, ich a Brand Xs 2nd nonitor 0 din anyditrent les wanccons Consequently, “quantty sed” cannot be aaa a pe inventory able becuse ican take on mulple value. Therefore, aaa spate quand acd” applies oa specie tem ncided in a pec alet Fe ong ne MN rdatonahip abe that is those Sv ents In Figure 58, notice dat information about ries sstoved.asan assis Bathe inventory and Sen rr The inventory able sores de suggested it price Ee ant br x pres Teapot THERE ‘ei abstr egg sles poe wha dag te coin of eer Surat of les promotions camntative daa Fgve 58 ao incindes some tbibutes such s"quansy on hand” in he ventory ble Te gecoum balangs” ithe customer ble, that cepresent camladve da, “Throsaly isuimneceaary fo sore tee emsteparatels he database, Bec the ‘oom ci fea compute then wen necessary For example information about the acid old foreach tem estored in the stlevinwentry he Information about ia eae would be stored in a nie abe lnking parchases and inventory To eeranequantyon Bad the AIS cod simply cle ce diference between the ‘fonts al he ony purchase. 2.afarmanner, he cash receipts ad nah ‘Eiiebineno bes contain ination abot cash init and evans, expect The lS ca cleat the fevence 1 eapay de currenchalace in he sb econ 182 Pawel Canepa Foun of Acuna tes _Eopllah sning cummin el alee howe er nay inprone respons “ie in queries whic explains ub Pgine BAM sete Sue TS ate, appropriate tbles Tis slink oul hr dare, however, the DBMS has the exp ‘ify to monsaall- pte these summary values ae eh ee eves BCC: he ie, he FTA TST be core to Implement 1:1 Step 3: Use Foreign Keys and 1:N Relationships MN relationships ms be implemented as separate ables o havea welstructured relational databace, lthongh 1: and TN relationships aso canbe implemented ax Sara ae cn my mor cent pee thn by me of ori Jj Recall rom Chapter 4 that a foreign key ian aeste of one entity tats ise the primary hey of another eniy, For example, dhe atuibute “eustomer number” ‘ight appene in both the customet and the sales tables IL would be the primary key ui the ester table, but a foreign key ipahesales table. So Tn a relational detabave, onetoone relationships ‘beeen ents ean be implemented hy icluding the primary key of one enya foreign key in the table representing the other entyy For purpose of designing @ wwelbsructred datas, the choice of which ble. place dhe foreign key in is bea Coefulanabsis of the minimum canals of de telaonship,hawexe. ‘Havsgitst which approach lielv to be moze ecient, Consider the 1 relasionship belween les abd eustomer payments depicted in Figure 97, Panel A. Tae minimus canal forthe sles event 0, indicating the abtence of recitals andthe mninimiim earinality for dhe cash receipts events Inieating that customer payments only ace afer arale has been made (eg. ere fare no adkance deposit) In the che, iladingisoice member he prinary key of the sles event) ata forsign key in the rash eceips event may be more efiieat Dbecawe shen ony cha one table auld have fo be accesed and updtel 1 proces Sout eae) customer pawnen. Muzeover, for Fi relaonships between ti) e ‘eal evens nliaing te Primary ey ofthe event thst acces isa 8 org ein the event hat rare second may prove intemal control. We wil ak mone rl internal contre at an As ith I eatonaip, BIN veaonships ln com be implemented reliinal databases wi Foreign keys. To do this place he primary key ofthe ent with the main evant of Saat fre Bey tn the enti: at hay naxinnn cama 1. or example. in Fire 48 the primary Kear ofthe saespern sn easter alsa ide a orig Rs the sles fable Sins the, pimary egw of he ea ctor. and eae whles a inches Tse Keys the eal eeeips table. 1 Figuie 3, Panel B, she atria lvelee her” won ape as ore Rey i the ey fees table, ye eae table for Fie 37, aed Chaees He fe Creme nuns ol appar ae a Toeig ey le mw table 3 peal exes ta genera ae for Spleen LEN rete sua cect ihe ean rts septal vet ees aa Use eve Prana neci st at tee Mt ea peep may ses ta eine fit eave nplementing the relatos ama spare table might ape intel elt Completeness check A Parenc i eotmentory Receipt UN) a s.r0 fone he exes of the lowing busines plici: eS celecon restionshp for inuaiment ales BS ton ranma at mos severe palin stone Salsa olecton rei na suaton when occa several shpenen are Caso i an ndorbeaune ore ems were out tock a. SE SSventry atonip for com homebuilder ‘sat The llowing tables and es extin a elatonal database ‘oie ututs Vendor endorf, name, street address, ci, tte Purchases POA, dave, amount, vendor, purchasing agent Trentory Receipts Recoving ceport. date, receivog clerk remark, FOF Cah Disbursed (Checkt, date amount Tea Reccips Cash Disvuned Check, receiving report amount applied 1 nels Required Retire 4 diagram for this daabse. Sate any aédisonal assumptions you need to make bout eaedialises. 48 puert Conceal Fondant Acco nfarmation Sem sparky Amemen Parks entertainment park ny recent calles grades aA Sra ered thers who ae Yung a hen. The omer we nested in PPO youn People Seamed nthe fron ses and marketing clases fo ope # =P Detter than any erin the ares. a ae gal, gues ofthe pak are gen personal ‘membership card” 28 hea lear Ge ae oie cc gues Asoane dats now a ed they ns ent he pr Ara Ten dese doe not ave 19 tack one penn ewer a period of ime = es, guess py at fefor the dys then ae ale 0 ide al of te eae eee Etopiny roller coaster and the mertygoround) fr no ers OATES ss gy ato wack the rides each guest takes andthe aration the fuels doe ene tea have guest ip their membership card trough scompateried 0 See ly ene information into the computer gem. Ths shoul alloy The owner to gather data about the following A a Ee ho se each pete of equipment (How many people ode the Pris wheel oay?) «uber of ies each plece efequipmentis operated daly Na oy ine atracion i bon of slow (When wa the carousel the buses?) Tae fy ions each guest wes (How nny diferent pce of equipment di cur tomer 1122 der) ee he tach gost enjoys (How many diferent ides i castomer 1122 eno? ia Ath guem go on any ries more han once?) a Reauiy ine ets (he people paces ting and eens in this busines) Tocntl the reasons bemeen the ees, Kei ef dings Ght model this stan ving se following deinions: aa ee tpment te eqepaent tht operated in dhe pk (eg Titi rer conte] 1 Soue te specifi tne hat he attraction is run + Gace the people who enjoy the rides ase ated om one develope fr canon se by DJ Sith Dai 3 ‘hr State Universi) SpernComputers, oe prods spare parisand sevice fr a ie ety of coma We Ficomp er fan pars to ke home fr digo epi hey may DE Cas fh they pa for both th para ad the aor acted wth dhe 9D Fae Pee are tld a pares aor ea 7 a aT mere po oral parts prchass illa the sine of, Ide Se Ia ent ca wey ring tr mutes ofr seine amd 8 Sa Coxe ase ese tee nny forall es (a ae a se MeFi cemputers es er diesen ooking acount a sens ‘poate iat ns ain ering eeu Required Regul jig af WeFieCamputer rennet, compe with ates Frere tampanns ne phase verry Fp from rena dae He elt test yeti, heer pp shies ps rt Cauerees ata Midland Danae sgn 49 don WeeFicConypaers pasfor one ofits porchases COD. bu sully pays by dhe 1h of se pou fo all puretases mud the prior nth. None of ix supplies allows it to make p ? Hsin payments Required pee REA diagram of We-FicCampte’ expenditure ele, complete wth cardinals pn ante! REA diagram of WeFieCampters, ine revenue and expendi gles ee pens 13a 319). Fie Resinnn Hospi sr by Dr. Bite Rooseet She has ovo enployes i the ne Mes hasaaked yo ts develop adaabase to help eter ack her da Dr, Roose cur src tacs ne petal comprue ony or word proceming, but she interested in avo using an ts pet rir an accouning nforition. She seaced about the wansion and segue thei her through he proces. Se deste er dal acide flows: eee ones meer come to bless Veterinary Hospi, the paren of dhe pete are sejiedta complete an tern for. Ths form inches the allowing * Ades + Day phone { Nigeephone "Frc are ik required to provie the following infor ely pe + Brest ae 5 bi ate eh wo thew enter thisinfonmation once and shen hve the sem etree for Wich cuore clo make apponiments one ofthe ofc leas what ind of vices he ce [neni roune aa angery et), Dr Roost ses nl one pet > Ey sattanwene ates going to sce one parents vo pes, hen two pate appoint ae reenact put scheduled acksobach) For each appointment, Dr. Roorevet ats he pate ng, notes the reaon forthe appelntnent, and records ber diagnosis Peer ee ater the doco wil posbly procrbe any number of mediation aoe oe eat charge 25 foreach appoint and mus py aédonally for any secs pra for Uae pets Ds Roouevet que al pes fo be brought back or rin enanaon prior eling any presets Costomer mis pay for servies and metiaton in fullat ike conhaion of rst ‘Ds Rocuvet conlnge the interview by requesting that in addon othe fact men- ioned above she wan the sen to sore he fllonng stb "Number of pets owned by ach parent + Length of appoismet aon about each pet a8 ome peo- ‘al charge forthe appoinument + Diagnosis + Presetpton price 1 Date of appointment * Deug name 1 Semice requested Required Ucn this bref overview. draw an REA diagratn for the Mesa Veterinary Hospital and clade eurinaien 150 ocr Cameep Fonttins Accounts se |b Asus arent plement one REA a ning aon aie Dra a ey lr ts ment Ince ll ies on the ext dhe alin res ined, Grete atonal stutes ony i neces rere adapted fom one crete frets: ws by De Jt Sith Davi ‘Assan Dofesor Asiana State Universi) a aan rea bls you te implement a database sven for ve brary network, Yow has aan eed seal orarans, und the following summarizes thee cuss snaps nain gal sto peovie sadete and prefers wi aces to books and oter see iteaoe The bry therefore tains a exes collection of atria hs ar Peele to anyone witha valid vniversyMentifcation ce enue est brocodae for loaning materia thatthe scent or fly rember comes raat ree campus braves an Yeates the book orjoureal on the shes wens amiga tec unique numbers athe book tasked amber by the pie aac de Intruational Smdard Book Narber (ISBN). This nutber allows the py | Teoh ach al moe hn ih oe sie, The end ae eee decimal umber wich signed to the tle and tenon dhe sie | BSRESPC book This maer sed o organ erases ads those ob aan ed eniy i therefore cial hat is nimber be aval to wer on the one | seen ee the et mumber a univeriy ok TO number. A diferent numer c erates. wes to rey book date receved the brary can ack all ope ofeach Book, This a er ctr te otro numbers that the Hira bas eve copies of one Poa ch wil ave unigue universe boot TD mmbet | cee a tat or faculy check ut books, the sjstem must be able wo track the specie saer ee ag orrowed Eacs book bara mages nip sete pine whl Co ere someone ave tobe a book wiht heckng i ot. 2 Sloman eee dems and cal have eal tin te rey. Bath are ble check a er ouievera bookea one Hine Nowe allowed io remove pei aoe ae sfc tng of tne tate book ay be botrowed varie, hee. a ey po cect iens Suen ate allowed in checkout aba fr eveal eck {cy may borrow books for teveral ment cea eee oat bots. they tke tel ters to de ution des, A ha a asi eah temerity ok ID number and te borowe's 1) ae ee en ava oan nme othe asacton a the me a aaa iy taatae thar each bok rete wasps loan). At hiss en eT ulate arse on apna nse each bok Fo ca ae ci nagar sip deca othe book ay be Femned e the iba ara rx check ot book hey ae expect to en hy de ae Afr ar ae dae ai the ve ate eee om sh cect lip bow | Rata Teen n e edt fe, Ihe hk permet Tt then ue rene inet Sz Fo ecu Al fen snus pa cs fl Sent are not awed a ier wabeaqent nemesis ua all Hay fines are pt cya dn a seven ipans ns wary ne are pi Fay ns pal sain Hy hye och yea > QuwrTnS Date Nodting nd Dasha Deven 151 + yten a ok is remmeel he retry ame evel oto the sen. and aque re tiers tn gi aston, Att an the kaa rece pete sho Taser retuned Tie fling sibs ae been Mens rte Hr the new qs uot ber Barren Dey deca uber ete ene | Boner alee ‘a ruaber Feu te Bonk enh date trove ian ner ee {tray bowed fom Car accon ume hese brian uber esa ame Avot of fe Account nance em (onthe seit eat ary where Total me of bk ‘eco "hot eh specie ary eater Beer fie Lenn sa (i ie orden) alone et ‘nding, ores) ibaa cogs degree ISBN umber Author ae Requted s- Dray an ER dlagrnn for dhe Hibrary system, using the REA template a a xarting point Reniember to include cardinals +, Dr the ables that would he required omplement your ER diagram, Only ust the ati es Isted ahowe, nes other areasltely neces. (This problem i adapted frm one developed by Dr. ale Sash Davia for assroom ws at ‘Avinona State Univers)

You might also like