Solutions Manual for Database Systems Design Implementation and Management 11th Edition by Coronel

Page 1

C hapter 2 Data Mod els

Solutions Manual for Database Systems Design Implementation and Management 11th Edition by Coronel Full clear download (no error formatting) at : https://downloadlink.org/p/solutions-manual-for-database-systems-designimplementation-and-management-11th-edition-by-coronel/ Test Bank for Database Systems Design Implementation and Management 11th Edition by Coronel Full clear download (no error formatting) at : https://downloadlink.org/p/test-bank-for-database-systems-designimplementation-and-management-11th-edition-by-coronel/

Chapt er 2 Data Mod els Di s cus sio n Fo cus Although all o f the topi c s cover ed in thi s ch apter are im portant, our stude nts have given us consi s tent feedback:Ifyoucanwriteprecisebusiness rules from a descript ion of operati ons, databas e designis notthatdifficult.Therefore,once dat a modelin g (S ecti ons 2.1 , "D ata M odel ing and D ataModels", Section2.2"TheImportanceofData Models,” an d 2. 3, “Data Model Basi c Buil ding Blocks,”)hasbeen examinedindetail,Section 2. 4, “Business R ule s,” shoul d receiv e a lot of classtimeandattention. Perhapsitisusefulto argue that the answ ers to questi ons 2 and 3 in the ReviewQuestionssectionare thekeyto successful de sign. That’s wh y w e hav e found it particularl y im portant to focus on business rules and thei r im pact on the database d esi gn proc ess . Wh at are b u sin ess rul es, w h at is th eir source, an d w h y are they cru cial ? Business rules are p re cise l y w ritten and unamb iguous statements that are d erived f rom a d etailed descriptionofanorganization'sope rati on s. Wh en w rit ten properly , busi ness rules defineoneormoreof thefollowingmodelingc omponents: enti ti es relations hips att ributes connecti vit ies 14


C hapter 2 Data Mod cardinali ti es – these will be ex ami elsned in detail in C hapter 3, “Th e R elatio nal Datab ase Model.” Basically,thecardinalitiesyield the mi nim um and max im um number of enti t y o ccu rrencesinan entity.Forexample,the relations hip decribed b y “ a professo r teach esoneormoreclasses” meansthatthePROFESS OR enti t y is re fer enced at least onc e and no mor e than fou r t im es in the C LASS enti t y. const raint s Bec ause the busi ness rules form the basis of the d ata modeling p rocess, the ir precise stat ement is crucial tothesuccessofthedatabasedesign. And, be cause the busi ness rul es are de rived from a precise descriptionofoperations,muchofthe desi gn 's s uccess d epends on the a ccura c y o f the desc riptio n of operati ons. Ex ampl es of business rules are: An invoice contains one or more invoi ce li nes. Each invoi ce li ne is asso ciated with a sin gle invoice. A store empl o ys man y e mpl o yees. Each empl o ye e is empl oye d b y onl y on e store. A coll e ge has man y d epa rtments. Each d epartment b elon gs to a sin gle coll e ge. (T his busi ness rule refle cts a unive rsit y th athas multiplecollegessuchasBusiness, Liber al Arts, Educati on, En gineeri n g, etc.)

15


C hapter 2 Data Mod els A driver ma y b e assi gned to drive man y di ffe rent vehicles. Each vehi cle c an be driv en b y m an y drive rs. (Not e: Keep in mi nd that thi s busi ness rule re flects the assi gnment of d rivers during som e p eriod of ti me.) A cli ent m a y sign man y contracts. Each contr act i s si gn ed b y onl y one cli ent. A sales rep resentative m a y writ e man y cont racts. Each contr act i s writ ten b y one s ales re pres entative. Note that ea ch r elations hip definiti on requires t he definiti on of two bus iness rules. Fo r ex ampl e ,the relationshipbetweentheINVOICEand (invoice ) LIN E enti ti es is defined b y the first twobusinessrules inthebulletedlist.Thistwo -wa y requir ement e x ists because there is al wa ys a two-wayrelationship betweenanytworelated enti ti es. (This t wo -w a y r elations hip descriptionalsoreflectstheimplementation b y man y o f the avail abl e database d esign tool s.) Keep in mi nd that the ER diagrams cann ot alwa ys refle ct all of the busi ness rules. For ex ampl e, ex ami ne the foll owing busi ness ru le: A custom er cannot be gi ven a credit li ne over $10,000 unless that customer has maintained a sati sfactor y c redit hist or y (as determi ned b y th e cr edit mana ger ) durin g the past t wo ye ars. This busi ness rule desc r ibes a const raint that ca nnot be shown in the E R diagram. Th e busi ne s s rule refle cted in thi s const rai nt would be h andled at the appli cati ons softw ar e level throu gh the use ofa triggerorastoredprocedure.(Your students will learn about tri gge rs and stored proc edures in C h apter 8, “Advanc ed S Q L.�) Given their im portan ce to successful design, w e cannot overstate the im portance of busi ness rulesand theirderivationfromproperlywrit ten d escriptio n of oper ati ons. It is no t t oo earl y tostartaskingstudents towritebusinessrules for sim ple descriptio ns of operati ons. Be gin b y usingfamiliaroperational scenarios,suchas bu yin g a book at the book store, re gist erin g for a clas s, pa yin g a parkin g ti cke t, or renti ng a DVD. Also, tr y rev ersin g the pr ocess: Give the students a chanc e to writ e the bus iness rules from abasicdata modelsuchastheonerepresentedby the tex t’s Figu re 2.1 and 2.2. A sk your students to writethe businessrulesthatarethefoundation of th e r e lational dia gram in Fi gure 2. 2 and th en pointtheir attentiontotherelationaltables in Fi gure 2. 1 t o indi cate that an AGENT occurr enc e canoccurmultiple timesintheCUSTOMERentity, thus il lust rati n g the impl ementati on im pact of the busi ness rules An a gent c an serv e man y custom ers. Each custom er is se rved b y one a gent.

16


C hapter 2 Data Mod els

Answ ers to Revi ew Ques tio ns 1. Discus s the imp ortan ce of d ata mod eli n g. A data model is a r elativel y sim ple rep resent ati on, usuall y graphi cal, of a more compl ex re alworld objectevent.Thedatamodel’smain functi on is to help us understand the compl ex it iesofthereal- worldenvironment.The database d esign er us es data models to fa cil it atetheinteractionamong designers,applic ati on programm ers, and end users. In sho rt, a gooddatamodelisa communicationsdevice that helps eli mi nate (or at least subst anti all yreduce)discrepanciesbetween thedatabase desi gn’s co mponents and the r eal w orld data environment.Thedevelopmentofdata models, bolst ered b y po werful datab ase desi gn t ools, has made it possi ble to subst anti all y dim ini sh the database d esi gn er ror potential. (R eview S ecti o n 2.1 in detail .) 2. Wh at is a b u sin ess rul e , an d w h at is its pu rp ose in d ata mod eli n g? A busi ness rule is a brief , precise, and unambi gou s descriptio n of a poli c y, procedur e, or principle withinaspecificorganization’s environment. In a sense, busi ness rules are mi snamed:theyapplyto anyorganization--abus iness, a gov ernment unit , a reli gious group, or aresearchlaboratory;large orsmall--that st ores and uses data to gene rate inf ormati on. Business rules are deriv e d from a descript ion of operati ons . As it s name im pli es, a descriptionof operationsisadetailed narrati ve that desc ribes the operati onal environmentofanorganization. Sucha descriptio n requir es gr eat pre cisi on and detail. If the des criptio n of operati ons is incorrector inomplete,thebusinessrulesde rived f rom it will not reflect the r eal world dataenvironment accurately,thusleadingto poor l y de fined d ata mo dels, whi ch l ead to poor databasedesigns.Inturn, poordatabased esigns le ad to poor appli cati ons, thus sett ing thestageforpoordecisionmaking– whichmay ult im atel y le a d to t he demi se of the or ganiz ati on . Note espe ciall y that b us iness rules help to cr eat e and enfor ce acti ons w it hin that organiz ation’s environment.Businessrulesmustber ende red in writ ing and upd ated to refle ct an y changeinthe organization’soperational environment. P roperl y writ ten busi n ess rules a re used to d efine enti ti es, att ributes, r elati onshi ps, andconstraints. Becausethesecomponents form the basis for a databas e desi gn, the car efulderivationand definitionofbusiness rules is crucial to good data base desi gn. 3. How d o you tran slate b u sin ess rul es in to data mod el co mp on en ts ? As a gen eral rule, a nou n in a busi ness rule will translate int o an enti t y i n the model, and a ve rb (acti ve o r passi v e ) asso ciating nouns will trans late int o a relations hip among the enti ti es.For example,thebusinessrule“acustomer ma y gene r ate man y invoi ces ” conta ins two nouns (customer andinvoice)andaverb(“generate” ) that associat e s them. 17


C hapter 2 Data Mod els

4. Describ e the b a sic f eatures of the r elation al d ata mod el an d d iscus s their imp or tance to th e en d u ser an d the design er. A relational d atabas e is a singl e data reposi tor y t hat provides both stru ctural and d ata independence whilemaintainingconceptual si mpl icit y. The relational d atabase model is perceived b y th e user to be a coll ecti on of tables in which dataare stored.Eachtableresemblesamatrix compos ed of row and colum ns. Tabl es are relat ed toeachother bysharingacommonvalueinoneof their colum ns. The relati onal model rep resents a b reakthrou gh f or users and d esi gners b ecause it lets them operate inasimplerconceptualenvironment. End users fi nd it easier to visuali z e their data asacollectionof dataorganizedasamatrix. Designers find it ea sier to de a l with con cep tualdatarepresentation, freeingthemfrom the co mpl ex ities associated wit h ph ysical d ata r epres entation. 5. E xp lai n h ow the en tity relation sh ip (ER) mod el helpedproduceamorestructuredrelational d atabase design en viron men t. An enti t y rela ti onshi p model, also known as an E R M, helps identif y the d atabase 's main enti ti esand theirrelationships.BecausetheERM compon en ts are graphic all y repr es ented, theirroleismore easilyunderstood.Using the ER dia gr am, it ’s eas y to map the ERM to the r elationaldatabase model’stablesandattrib utes. This m apping pro ce ss uses a series o f well -definedstepstogenerateall therequired databas e structures. (This structure s mapping approa ch is augm ented b y a pro ces s known as normali z ati on, which is covere d in detail in C hapter 6 “Normali z ati on of Database Tables.”) 6. Cons id er the scen ario d escrib ed b y the state me nt“Acustomercanmakemanypayments,but each p ay men t is mad e b y on ly on e cu sto me r” as the b asisforanentityrelationshipdiagram (ERD) rep resen tation . This scenario yi elds the ERDs shown in Fi gur e Q2. 7. (Note th e use o f th e P owerPoi nt C row’s Fo ot template.WewillstartusingtheVisioP rofessi onal -gene rated C row’s Foo t ERDs in C hapter3,but youcan,ofcourse,continuetous e the templ ate if you do not hav e ac cess t o Visi o P rofessi onal.)

Fi g ure Q2.7 The Chen and Crow ’s Foo t ERDs for Ques ti on 7

18


C hapter 2 Data Mod els Chen mo de l 1M CU S TO M ER

ma ke s

P AYM EN T

Cr o w’ s F o ot m ode l

CU S TO M ER

ma ke s

P AYM EN T

NOTE Re min d you r stud en ts again that w e h ave n ot (yet ) il lu strated t h e ef f ect of op tion al relation sh ip s on the E RD’s p re s en tation . Op tion al relation sh ip s and their t reat men t a re cover ed in d etail in Chap ter 4, “E n tity Relation sh ip (ER) Mod eli n g.”

7. Wh y is a n ob ject said to have greate r se man tic con ten t th an an en tity? An object has great er s e mantic content b ec ause it embo dies both dat a a nd behavior. That is, the object contains, in addit ion to data, also the descriptio n of the operati ons that ma y be per formed b y the object. 8. Wh at is the d if f eren ce b etw een an ob ject an d a class in the ob ject oriented d ata mod e l (OODM)? An object is an inst anc e of a spe cific cl ass. It is useful to point out that the object is a run -ti me concept,whiletheclassisamorestaticdes criptio n. Objects that shar e sim il ar ch ara cterist ics ar e gro uped in classes. A class is a coll ecti on of similar objectswithsharedstructure(att ributes) and be havior (methods .) There fore, a classresemblesan entityset.However,acla ss also i ncludes a set of p rocedur es known as meth ods.

18


C hapter 2 Data Mod els 9. How w ou ld you mod el Q u estion 6 with an OODM? (Use Figu r e 2. 4 as you r gu i d e.) The OODM that co rresp onds t o questi on 7’s ERD is shown in Figu re Q1. 10:

Fi g ure Q2.10 The OODM Mo del fo r Ques ti o n 10 CU S TO M ER M P AYM EN T

10. Wh at is an E RDM, an d what role d oes it p lay in the mod ern (prod u ction ) d atabase en vironmen t? The Ex tended R elational Data Model (ER DM) is the relational data model’s response to the Object OrientedDataModel(OODM.)Mostcurr ent R DBMS es support at le ast a few of the ERDM ’s ex tensions. For ex ampl e, support for lar ge binar y objects (B LO Bs ) is now comm on. Although the "ERDM " label has fr equentl y be e n used in the databas e li terature to des cribe th e relational datab ase mode l's respons e to the OOD M's ch all en ges, C . J . Date objects to the ERDM label for the foll owin g r e asons: 1 The useful contribut ion of "th e obje ct model" is it s abil it y to let use rs de fine their o wn -- and often ver y compl e x -- data t ypes. Ho we ver, mathematic al struc tures knownas "domains"intherelational model also provide thi s abil it y. The refo re,arelationalDBMS thatproperlysuppo rts s uch domains gr eatl y di mi nishes the reasonforusingtheobject model.Given proper sup port for domains, relational database models ar e quit e capable of handli ng th e compl ex data encounte red in ti me series, en ginee ring d esign, of fice autom ati on, financial m odeli ng, and so on. Be cause the relational model can support complexdatatypes,thenotionof an "ex tended relational databas e mod el" orERDMis "extremelyinappropriateand inac curat e" and "it s hould be firml y resis ted."(Thecapability thatissupposedly bein g ex tended is alread y ther e !) Even the label ob ject/r elation al mod el (O/ RDM) is not quit e accura te, because the relational database mode l's domain is not an object model structure. However, ther e are alreadyquiteafewO/Rproducts-- also known a s Uni versal Datab ase Serve rs --onthe market.Therefore,Dateconced es that we are pr obabl y stuck with the O/R label.Infact, Datebelievesthat"anO/R s ystem i s in ever yon e 's future. " Mor e pr ecisely,Datearguesthat atrueO/Rsystem would be "nothi ng more no r les s than a tru e r elational s ystem -- which is to sa y, a s yst em t hat supp orts the relational model, with all t hat such support entail s."

19


1

C . J . Date, "Ba ck To the R elationa l Future ", htt p:/ /www.dbpd.com/ vault /9808date.htm l

20


C hapter 2 Data Mod els C . J . Date concludes his discussi on b y obs ervin g that "W e need do nothi ng to the rel ati onal model achieveobjectfunctionality.(Nothin g, th at is, ex cept im plement it , somethi ng that doesn'tyetseem tohavebeentriedinthecomm ercial wo rld.)" 11. Wh at is a relation sh ip , an d w h at th ree types of relation sh ip s exist? A relations hip i s an assoc iation among (two o r mo re) enti ti es. Thr ee t ypes o f relations hips exist:one- to-one(1:1),one-to-many(1:M), and man y-to-ma n y (M:N o r M:M.) 12. Give an exa mp le of eac h of the th ree types of relation sh ip s. 1:1 An ac ademi c d epa rtmen t is chaired b y on e pro f essor; a p rofesso r ma y c hair onl y on e acad emi c department. 1:M A custom er ma y gen erat e man y invoi ces; ea ch in voice is gener ated b y one custom er. M:N An empl o ye e ma y h ave e arned man y d e gre es; a de gr ee ma y h ave be en e arn ed b y m an y empl o yees. 13. Wh at is a tab le, an d w hat role does i t pl ay in the relation al mod el? S trictl y spe aking, the re lational data model bas es data stora ge on r elat ions . These relationsare basedonalgebraicsettheory. Howev er, the u ser per ceives th e rel ati ons to be tables.Inthe relationaldatabaseenvir onment , designers and u sers perceiv e a table to beamatrixconsistingofa seriesof row/column int ersecti ons. Tabl es, also call ed relations , are rel ate d to each other b y sharing acommonentitycharacteristic.For ex ampl e, an INVO IC E tabl e would co ntain a custo mernumber thatpointstothatsamenumberin the C USTOME R table . This featur e ena bles the R D BMStolink invoicestothecustomerswhogener ated them. Tables ar e especi all y use ful from the modeling an d im plementation perspececti ves. Bec ause tables areusedtodescribetheentitiesthey repr esent, the y p rovide a n e as y wa y to summ ariz eentity characteristicsandrelationships among enti ti es. And, b ecaus e the y are purel y conceptual constructs,thedesignerdoesnot need to be conce r ned about the ph ysic al im pl ementati on aspects of the database d esi gn.

21


C hapter 2 Data Mod els 14. Wh at is a relation al d iagra m? Giv e an exa mp le . A relational dia gram is a visual rep resent ati on of the r elational datab as e’s enti ti es, the attributes withinthoseentities,andther elations hips betw een those ent it ies. The re fore,itiseasytoseewhat theentitiesrepr esent and to see wh at t yp es of rela ti onshi ps (1:1,1:M,M:N)existamongtheentities and how those relations hips are im plemented. An ex ampl e of a relational diagram is found in the tex t’s Figure 2. 2. 15. Wh at is con n ectivity? ( Use a Crow ’s Foot ERD to ill u strate con n ectivit y.) C onnecti vit y is t he relati onal t erm to describe th e t ypes of relations hips (1: 1, 1:M, M :N).

In the fi gur e, the busi nes ss rule that an adviso r ca n advise man y stud ents a nd a student h as onl y one assignedadvisorisshownwithinarelati onshi p with a conn ecti vit y of 1:M. The busi ness rulethata studentcanregisteronlyone vehicle to p ark on c a mpus and a vehicl e can be re gisteredbyonlyone studentisshownwitha relatio nshi p with a conn ecti vit y of 1:1. Finally,therulethatastudentcan register for man y classe s, and a class can be regist e red forbymanystudents,isshownbythe relations hip wit h a conne cti vit y of M:N. 16. Describ e the Big Data p h en omen on . Over the l as t few yea rs, a new wave of dat a has “ emer ged ” to the li meligh t. S uch data hav e alsw a ys exsistedbutdidnotrecivetheattention that is r eceivi n g toda y . Thes e d ata ar e cha ra cterizedfor beinghighvolume(petabytesize a nd be yon d), high fr equenc y (da ta are gen erated alm os t const antl y), and most l y s emi -structured. Thes e da ta come from mul ti ple and vatiedsourcessuchas websitelogs,websitep osts in social sit es, and machine gene rated information(GPS,sensors,etc.) Suchdata; have be en a c cumul ated over the ye ars and companiesarenowawakiningtothefactthat it contains a lot of hidd en information that could help the da y-to -da y b usiness (such as b rowsi ng patt erns, purch asing p ref erenc es, beh aivor patt ern s, etc.) The n eed to man age and lev er a ge thisdata hastriggeredaphenomenonlabeled “Bi g Dat a”. B ig Data refers to a movement to find newand 22


C hapter 2 Data Mod betterwaystomanagelargeamountsof els web - ge nerated dat a and derive busi ness insi ghtfromit, while,atthesametime,providing hi gh per forma nce and sc alabili t y at a re asonable cost.

23


C hapter 2 Data Mod els 17. W hat does the term “3 vs ” ref ers to? The term “3 Vs ” re fers to the 3 basic cha ra cterist ic s of Bi g Dat a databas es, the y are: Volume: R efers to the a mount s of data being sto red. W it h the adopti on and growth of th e Inte rnet and socia l medi a, companies h ave mul ti pli ed the wa ys to rea ch c ustom ers. Over theyears,andwiththebenefitof technologi cal advanc es, data for mi ll ionsofetransactionswerebeingstored dail y on compan y databases. Furthermo re, organizations areusingmultiple technologies to int eract with end users andthosetechnologiesare generating mount ains o f data. This eve r - grow ing volumeofdataquicklyreached petabytes in s iz e and it 's sti ll growing. Velocit y: R efe rs not onl y to th e spe ed with whi ch data grows but als o to the need to process thes e d ata quickl y in o rder to gen erat e in formation and insi ght. W it h the advent oftheInternetandsocialmedia, busi ness resp onses ti mes have shrun k considerably. Organizationsneednot onl y to store lar ge volum e s of quickl y ac c umulatingdata,butalso needtoprocess such dat a quickl y. The velocit y o f data growthisalsoduetotheincrease inthe number o f diff eren t data stre ams from whic h data is bein g piped to t he or ganiz ati on (via the web, e-comm e rc e, Tweets, Fa cebook post s, emails, s ensors, GPS , and so on). Variet y: R efe rs to the fa ct that the data bein g coll ected comes in mul ti ple differ entdata formats.Agreatportionofthese data comes in fo rmats not suit able to be handledbythe typicaloperationaldatab ases based on t h e relation al m odel. The 3 Vs frame work il lust rates what companie s nowknow,thattheamountofdatabeing coll ected in their datab ases has be en gro wing ex ponenti all y in siz e and co mpl ex it y. Tr adit ional relationaldatabasesaregoodatmana gin g stru ctur ed data but ar e not w ell sui ted to managingand processingtheamountsandt ypes of d ata bein g co ll ected in toda y's busi n ess environment. 18. W hat i s Haddop and wha t are it s basic component s? In o rder to cre ate value f rom their previous l y unu sed Bi g Dat a store s, com panies ar e using n ew BigDatatechnologies.Theseemerging technolo gies all ow or ganiz ati ons to process massivedata storesofmultipleformatsin cost -ef fecti ve wa ys . S ome of the most fr eq uentlyusedBigData technologiesareHadoop and MapR educ e. Hadoop is a J ava bas ed, open sour ce, hi gh spee d, fault -tol er ant dist ributed stora geand computationalframework.Hadoop us es low - cost hardwa re to cr eate clust e rs ofthousands ofcomputernodestostore and process dat a. Had oop originated from Google'sworkon distributedfiles ystems a nd parall el processi n g an d is currentlysupportedbytheApache S oftware Foundati on. 2 Ha doop has sev eral modul es, but the two m ain co mponents are Hadoop Dist ributed Fil e S ystem (HD FS ) and M ap R educe. Hadoop Dist ributed Fil e S ystem (HD FS ) is a hi gh l y dist ributed, fault -tol e r ant file storage systemdesignedtomanagelarge amount s of d ata at high sp eeds. In orde r t o achievehigh throughput,HDFSusesthe writ e -on ce, r ead man y model. This mea ns thatoncethedata iswritten,itcannotbe m odified. HDFS uses thr ee t ypes o f nodes: a namenodethatstores allthemetadata about the file s ystem; a dat a nod e that stores fix ed 24


C hapter 2 Data Mod siz e data blocks (that could elsbe r epli cated to other data nod es) and a cli ent node that a cts a s the int erfa ce between the us er appli c at ion and the HDFS .

2 Fo r mo r e in fo r mat io n ab o ut Had o o p visit had o o p . ap ac he. or g.

25


C hapter 2 Data Mod els MapR educe is an open s ource appli c ati on progra mm ing int erfa ce (AP I) th at providesfast dataanalyticsservices. MapR educe dist ributes the processi ng of thedataamong thousandsofnodesinpa rall el. MapR edu ce works with structured andnonstructureddata. TheMapReducefr amew ork provides two main f uncti ons, Map andReduce.Ingeneral terms,theMapfun cti on takes a job and divi des it int o smallerunitsofwork;theReduce functi on coll ects all t he o utput result s gen erated fr om t he nodes and int e gr a tes them i nto a single r esult set.

19. Wh at is sp arse d ata? Gi ve an exa mp le. S parse data re fers to cas es in which the number of att ributes a re v er y la r ge, but the numbe rs butthe actualnumberofdistinctvalueinst ances is rel ati vel y sm all . For ex ampl e, if you a remodelingcensus data,youwillhaveanenti tt y call ed pe rson. This enti t y pe rson can h ave h undredofattributes,some ofthoseatt ributes would be first name, last n ame, degre e, empl o yer, in co me, vetera n status, forei g n born, etc. Although, ther e would be man y mi ll ions of rows of d ata fo r e ach pe rson, the re will b e manyattributesthatwillbeleftblank,for ex ampl e, not all pe rsons will ha ve a d e gre e, an incomeor anemployer.Evenfewerpersonswill be veterans or foreign born. Ever y ti me that you haveandata entitythathasmanycolumnsbut the data inst a nces fo r the colum ns a r e ver y low (manyempty attributeoccurrences)itissaid that you hav e spars e data. There is another related termi noli gy, data spar ci t y th a t refe rs to the number of different valuesa fivencolumnscouldhave.Inthis case, a colum n such as “gend er” alt hou gh it will havevaluesfor allrows,ithasalowdata sparcit y b ecaus e the number of different valuesisonytwo:maleor female.Acolumnsuch as name and birthd ate w il l have hi gh data spar ci tybecausethenumberof differentvaluesishi gh. 20. Def in e an d d escrib e the basi c ch aracte ristics of a NoSQ L d atabase. Ever y ti me you sea rch fo r a product on Am az on, send messa ges to f riends i n Fac ebo ok, wat ch a video in YouTube or se ar ch for dire cti ons i n Google Maps, you ar e usi ng a NoSQ L d atabase. NoSQ L refers to a n ew generati on of d atabas es that address t he v er y spe cif ic chall en ges o f the “bi g data” e ra and h ave the fo ll owing gene ral ch ara cter ist i cs: Notbasedon the r elational model . These datab ases a re gen e rall y b ased on a v ariati on of the ke y-v alue data mo del rather th an in t he relational model, henc e t he NoSQ L name . Th e ke y-valu e data mod el i s based on a structur e compos ed of two data ele ments: a ke y and a v alue; in which for ev er y ke y t here is a correspondi n g v alue (or a set of values ). The ke y- value data model i s also r efer red to as the att ribute-value or associa ti ve data model. In the ke y- v alue data mod el, ea ch row rep resents on e att ribute of one enti t y inst ance. The “ke y” colum n point s to an att ribute and the “value ” colum n contains t he actual v alue for the att ribute. Th e data t ype of th e “valu e” colu 26


C hapter 2 Data Mod mn i s gene rall y a lon g string toels ac comm odate th e variet y of actual dat a t ypes of the values t hat are placed in t he colum n. Supportdi stribut ed database ar chit ectur es . One of the bi g adv anta ge s of NoS Q L d atabas es is that the y gener all y us e a dist ributed

27


C hapter 2 Data Mod els archit ectu re. In fact, sev e ral of them (Cassand ra, Big Table) ar e desi gned t o use low cost comm o dit y serv ers to for m a compl ex network of dist ributed database node s Providehighscalabilit y, high av ail abil it y and f aul t t olerance . NoSQ L d atabases are d e signed to s upport t he abil it y to add c apacit y ( add d atabase nod es to t he dist ributed database) whe n the demand is hi gh and to do i t t ransparentl y an d without downtim e. Fault tol erant m e ans t hat i f one of the nodes in t he dist ributed database f ail s, the database will keep oper ati ng as normal . Supportveryl ar ge amount s of sparse dat a . Bec ause NoSQ L d ata bas es use the ke y- value dat a model, the y are sui ted to handle ver y hi gh volum es of sparse d ata; that is for cas es wher e the number of att ributes is v er y lar ge but t he number of a ctual data ins tances is low. Gearedtowardperforma nce rath er than tr ansacti o n consi stenc y. One of the bi ggest proble ms of ver y lar ge dist ributed databas es is to enforc e data consi stenc y. Dist ributed databases autom ati call y mak e copies o f data elem ents at m ult iple nodes – to ensur e high av ail abil it y and f aul t t olerance. If the node w it h the requested dat a goe s down, the request can be se rved f rom an y o ther node with a cop y o f the data. How ever, what happen if the netwo rk goes do wn durin g a dat a update? In a rel ati onal da tabase, trans acti on updat es are gu arant eed to be consi stent or the trans acti on is rolled back. No S Q L data bases sa crific e consi stenc y in order to att ain hi gh lev els of per f ormance. NoSQ L d ataba ses provide ev entual con sis tenc y. E ven tual con sis ten cy is a fe ature o f NoS Q L d atabas es that i ndicates that data are not gua rant e ed to be consi stent i mm ediatel y a fter an upd ate (a cross all copies of the dat a) but rat her, that updates will propa gate throu gh th e s ystem and eventuall y all d ata copies wil l be consi st ent.

21. Usin g the exa mp le o f a med ical cli n ic w ith p atientsandtests,provideasimple represen ta tion of h ow to mod el this exa mp le u sin g the relationalmodelandhowitwoldbe represent ed u sin g the key -valu e d ata mod eli n g tech n iq u e. As you can se e in Fi gur e Q2.21, the relational mo del st ores data in a tabul a r format i n whi ch e ach rowrepresentsa“record�foragivenpati ent. W hil e, the ke y-valu e data mo del uses threediffernet fieldstorepresenteachd ata element i n the r ecord. Therefo re, fo r e ach pati e nt row, there are thr ee

28


C hapter 2 Data Mod els rows in t he ke y-v alue model.

22. Wh at is logi ca l ind ep end en ce? L ogical in d ep end en ce ex ist s when you can c hange the int ern al model without affe cti ng th e conceptual model. W hen you discuss logic al and other t yp es of independen ce, it ’s worthw hil e to discuss and review some basic modeli ng con cepts and t erminol o g y: In gene ral te rms, a mode l is an abstr acti on of a m ore compl ex re al -world object or event.A model’smainfunctionistohelp you under stand the compl ex it ies of the r eal -world environment.Withinthedatabase environment, a data mod el r epres ents d ata structuresand theircharacteristics, relat ions, const raint s, and transformations. As it s name im pli es, a purely conceptualmodelstandsatthehi ghest level o f abstracti on and focus es on thebasicideas (concepts)thatareex plored in the model, wit hout specif yin g the detailsthatwillenablethe designerto implement t he model. For ex ampl e, a conc eptualmodelwouldincludeentities and their relations hips and it ma y even include a t least some of the att ributes that define the entities,butitwouldnotincludeatt ribute detail s such as the nature of t he att ributes(text, numeric,etc.)orthephys ical st ora ge r equireme nts of thos e att tribut es. The terms data model a nd databas e mod el ar e often used int erch an gea bl y. In the t ex t , the termdatabasemodelisbeusedtorefer to the i mpl ementati on of a data model in a specific database s ystem .

29


C hapter 2 Data Mod Data mod els (rel ati vel y simelsple rep resentations, usuall y graphi cal, o f m ore complexrealworlddatastructures),b olst ered b y powe rful database desi gn tool s,havemadeitpossibleto substantially dim ini sh t he potential for e rrors in d atabase d esign.

30


C hapter 2 Data Mod els The in tern al mod el is the repres entation of the database as “s een” b y th e DBMS . In other words, the int ernal model requires the designe r to match the conceptual model’s ch ara cterist ics and const r aint s to t hose of the selec ted impl ementati on model. An in tern al sche ma dep icts a specific rep resentat ion of an int ernal m odel, using the database constructssupportedbythe chosen dat abase. The ext ern al mod el is t he end users ’ vi ew of th e data environment. 23. Wh at is p h ysical in d ep en d en ce? You have p h ysical in d ep en d en ce when you can chan ge the physi cal mo del without aff ecti n g the internalmodel.Therefore,achangein stor a ge d evices or methods and e ven a chan ge in operating systemwillnotaffecttheinternal m odel. The terms ph ysical m ode l and internal m odel m a y require a bit of addit iona l di scussi on: The p h ysical mod el ope rates at the lowest level of abstracti on, desc ribing the wa y d ataare savedonstoragemediasuchasdisks or tapes. Th e ph ysic al model require s the definitionof boththephysicalstorage devices and th e (ph ysic al) ac cess m ethods r equiredtoreachthedata withinthose storage d evices , makin g it both software - and ha rdwar e-d ep endent. The stora ge structures used are depen dent on the softwa re ( D BMS , operati n g s ystem) and on the t ype o f storagedevicesthatthecomputercan handle. The precisi on required in the ph ysi calmodel’s definitiondemandsthat database desi gne rs who work at thi s level h aveadetailedknowledge ofthehardware and soft ware us ed to i mpl ement the databas e desi gn. The in tern al mod el is the repres entation of the database as “s een” b y th e DBMS . In other words, the int ernal model requires the designe r to match the conceptual model’s chara cterist ics and const raint s to those of the sel ected im plementation m odel. An in ternal schemadepictsaspecificrepr esentation of an int ernal model, using the d atabaseconstructs supportedbythe chosen database.

31


C hapter 2 Data Mod els

Pro blem So l utio ns Use the con t en ts of Figu re 2. 1 to w ork p rob lems 1 -3. 1. Write the bu sin ess rul e(s) that govern s the r elat ion sh ip b etw een AGE NT an d CUS T OMER. Given the data in the two tables, you can s ee that an AGENT – th rou gh A GENT_C ODE -- can occu r man y ti me s in the C USTOMER table. But each custom er has onl y on e agent. the rules, bus iness ma y be wthritten as follows: Given Ther theseefor busie,ness you rules c an conclude at there is a 1:M relations hip between One a gent can hav e man y custom e AGENT and C USTOME R . rs. Each custom er h as onl y one a 2. Giv en the bugent. sin ess rul e(s) you w rote in Prob le m 1, crea te the basi c C r ow ’s Foot ERD The C row’s Foot ER D is shown in Figu re P 2.2a. .

Fi g ure P2 . 2a The Crow ’s Fo o ERD fo r Pro blem 3 t

AGEN T

se r ve s

CU S TO M ER

which conne cti vit ies (1,M) are repr esented. Th e C hen ERD is shown in Figure P 2.2 b.

Fi g ure P2 . 2b The Chen ERD for Pro bl em 2 For discussi on purpose s, you mi ght use th e C hen model shown in Fi gur e P 2.2b . C ompare the two rep res entations of the busi ness rules b y noti n g the dif f erent wa ys in

Chen mo de l 1M AGEN T

se r ve s

27

CU S TO M ER


C hapter 2 Data Mod els 3. Usin g the E RD you d rew in Prob lem 2, crea te the eq u ival en t Ob ject r ep resen tation an d UM L class d iagram. ( Use Fig u re 2. 4 as you r gu id e.) The OO model is shown in Figu re P 2. 3.

Fi g ure P2 . 3 The OO Mo del fo r Pro bl em 3

AGEN T M CU S TO M ER

Usin g Figu re P2. 4 as y ou r gu id e, w ork Prob lems 4– 5. T h e DealCo r e lation al d iagram sh ow s the in itial en tities and attrib u tes f or the DealCo st ores, locat ed in tw o region s of the cou n try.

Fi g ure P2 . 4 The Dea l Co r ela tio nal diagra m 4. Id en tif y each rela tion ship type and w rite all of th e b u sin ess rul es. One re gion can b e the lo cati on for m an y stores. E ach store is located in on l y one re gion. Th ere fore, therelationshipbetweenREGIONandS TOR E is 1:M. Each store empl o ys on e or more empl o ye es. Ea ch empl o ye e is empl o yed b y one store. ( In thi s case, weareassumingthatthebusinessrule specifies that an empl o yee canno t work in more thanone storeatatime.)Therefore,the relations hip betw ee n S TOR E and EMP LOY EE is 1: M. A job – such as accountant or sale s represent ati ve--canbeassignedtomanyemployees.(For ex ampl e, one would rea sonabl y assum e that a st ore can h ave mor e than one sales rep resent ati ve. Therefo re, the job ti tl e “S ales R epr esentative ” c an be assi gned to more than one employeeata time.)Eachemployeecanhaveonl y on e job assignment. ( In thi s case, we are assum ingthatthe 28


C hapter 2 Data Mod businessrulespecifiesthatan empl oels yee c annot have more than one job assi gnmentatatime.) Therefore,therelationshi p between J OB and EMP LO YEE is 1: M.

29


C hapter 2 Data Mod els 5. Creat e the b asic Crow’sfFoot ERD or D ealCo. The C row’s Foot ERD is s hown in Figu re P 2. 5a.

t o ERD fo r Dea l Co Fi g ure P2 . 5a The Crow ’s Fo is loc at io n f or REG IO N S TO RE

e mplo ys

JO B

is a ssig ne d t o

EM P LO YEE

The C hen model is show n in Fi gur e P 2. 5b. (Note that you alw a ys r ead the relations hip fro to t he “M” side.) m the “1”

Fi g ure P2 . 5b The Chen ERD fo r Deal Co 1M REG IO N

S TO RE

is loc at io n f or

1

e mplo ys M EM P

1M JOB

is a ssig ne d t o

LO YEE

30


C hapter 2 Data Mod els Usin g Figu re P2. 6 as you r gu id e, w ork Prob lems 6−8 T h e T in y College relation al d iagram sh ow s the in itial en tities and attrib u tes f or T in y College.

Fi g ure P2 . 6 The Ti ny Co ll eg e r ela tio na l di ag ra m 6. Id en tif y each relation ship type and w rite all of th e b u sin ess rul es. The sim plest wa y to il lu strate the relations hip be tween ENR O LL, C LASS , and S TUDENT is to discuss the dat a shown i n Table P 2. 6. As you ex ami ne the Table P 2. 6 co ntents and compar e the att ributes to relational sc hema shown in Fi gur e P 2. 6 , note these fe atures: W e have added an att ribu te, ENR O LL_S EMES TER, t o identif y the enrollm ent period. Naturall y, no grade has yet be en assi gned whe n the student is first en roll ed, so we have enteredadefaultvalue“NA”for“Not Applicable.” The letter gr ade – A, B, C , D, F, I (Incomplete),orW(Withdrawal)--will be ent ered at the conclusi on of the enrollm ent period, the SP R ING -12 s emester. S tudent 11324 is en rolled in two cl asses; stude nt 11892 is en rolled in three classes, and student 10345 i s enrolled in one class.

Ta bl e P2.6 Sa mpl e Co ntents of a n ENROLL Ta bl e S T U_NUM 11324 11324 11892 11892 11892 10345

CLASS _CODE MATH345 -04 ENG322-11 C HEM218 -05 ENG322-11 C IS 431 -01 ENG322-07

E NROL L _S E MES T E R S P R IN G -1 4 S P R IN G -1 4 S P R IN G -1 4 S P R IN G -1 4 S P R IN G -1 4 S P R IN G -1 4

E NROL L _GRADE NA NA NA NA NA NA

All of the relations hips ar e 1:M. The relations hips ma y b e writ ten as follow s:

31


C hapter 2 Data Mod C OUR S E gener ates C LAS S . One elscourse can ge nerate man y class es. Ea c h class is gene rated b y o ne course.

32


C hapter 2 Data Mod els C LASS is ref eren ced in ENR O LL. One class ca n be re fer enc ed in enrol lm ent man y ti mes. E ach indi vidual enrollm ent refer enc es one cl ass. N otethattheENROLLentityisalsorelatedto S TUDENT. Ea ch entr y i n the ENR O LL enti t y re feren ces on e student and the class for which that student has enrolled. A s tudent cannot enroll in the same class mor e than once. If a student enrolls infourclasses,thatstudentwill appear in the ENRO LL enti t y four ti mes, each ti me for a di ffere nt class. S TUDENT is shown in ENR O LL. One student can be showninenrollmentmanytimes.(In database desi gn te rms, “ man y” sim pl y means “ m ore than onc e.” ) Ea ch in divi dual enrollm ent ent r y shows one student. 7. Creat e the basi c Crow s Foot ERD or T in y Co ll ’ege. f The C row’s Foot m odel i s shown in Figu re P 2. 7a.

Fi g ure P2 . 7a The Crow ’s Fo t o Mo del for Ti ny Co ll eg e CO UR SE

g e ne rat es

CL ASS

is re f e re nc e d in

is sh o wn

in P 2. 7b. The C hen model is shown in Figu re S TUD EN T ENR O LL

Fi g ure P2 . 7b The Chen Mo del for Ti ny Co ll ege

1M CO UR SE

CL ASS

g e ne rat es

1

is re f e re nc e d in M ENR O

1M S TUD EN T

is sh o wn in

LL

31


C hapter 2 Data Mod els 8. Creat e the U ML class d iagram that ref lec ts t h e en tities an d relation sh ip s you id en tified in the relation al d iagram. The OO model is shown in Figu re P 2. 8.

Fi g ure P2 . 8 The OO Mo del fo r Ti ny Co ll ege CO UR SE

S TUD EN T

ENR O LL

CL ASS

CR S_ CO DE C CR S_

CL ASS_ CO DEC CL ENR O LL_ S EM ES TER

S TU_ NU M C S TU_

C ENR O LL_ GR ADE C

LN AM E C STU_F

DESCR IP TIONC CRS_ CR ED IT N

NAMEC S TU_ IN

CL ASS ES: CL SES:

AS

CL ASS

CL ASS S TUD EN TS:

ASS_

TIM

EC

CLASS_ RO O M C

ITIALC S TU_ DO B

M M

ASS_ D AYS C CL

CO SES:

D ENR O L LM EN T:

M

S TUD EN T

UR 1

M

CO UR SE

ENR O LL ENR O L LM EN T:

Not e : C = Cha r ac t er D = D at e N = Nu me ric

M

ENR O LL

9. T yp ically, a p atien t s ta yin g in a h osp ital rece ives med ication s that h ave b een ord e red b y a p articu lar d octor. B eca u se the p atien t of ten receives seve ral med icati on s p er d ay, there is a 1:M r elation sh ip b etw een PATIE NT an d ORDER. S imil arly, ea ch ord er can in clu d e severa l med ication s, crea tin g a 1:M rela tion sh ip b etw een ORDER an d ME DICATIO N. a. Id en tif y the bu sin ess rules f or PATIE NT, O RD E R, and ME DICATION. The busi ness rules r eflect ed in t heP AT IENT des cr ipt ion are: A pati ent can h ave man y (medical) ord ers w ritten for him or he r. Each (medi cal) ord er is writ ten for a sin gle p ati e nt. The busi ness rules r efe cted in the OR DER descrip tionare: Each(medi cal) ord er c an prescribe manymedications. Each medic ati on can be prescribed in m an y o rder s. The busi ness rules r efe cted in the M ED IC AT IO N descriptio n are: Each medic ati on can be prescribed in m an y o rder s. Each (medi cal) ord er c an prescribe m an y medicati ons. 32


C hapter 2 Data Mod b. Creat e a C row 's Foot E RD that els d ep icts a re lation al d atabase mod e l to cap ture these b u sin ess rul es .

33


C hapter 2 Data Mod els

Fi g ure P2 .9 Crow 's fo ot ERD for Probl em 9

10 . Uni ted B rok e Artists ( UBA) is a b rok er f or not -so-famouspainters.UBAmaintainsasmall n etw ork d atabase to track p ain ters, p ain tings, andgalleries.Apaintingispaintedbya p articu lar artist, an d t h at p ain tin g is exh i b ited in a p articu lar gall ery. A gall ery can exh ibit manypaintings,buteachpaintingcanbe exh ib ited in on ly on e gall er y. S i mil arly, a p ainting ispaintedbyasinglepainter,but each p ain ter can p ain t man y p ain tin gs. Usin g PAINTER, PAINTING,andGALLERY,intermsofa relat ion al d atabase: a. Wh at tab les w ou ld you creat e, an d w h at w ou ld the tabl e co mp on en ts be? W e would create the th ree tables shown in Fi gure P 2.10 a. (Use the te a cher’s Ch02_ UBA database in your instru ctor's resour ces to i ll ustrat e the table contents.)

FI GURE P2 .10a The UBA Da ta ba s e Tabl es

34


C hapter 2 Data Mod els

35


C hapter 2 Data Mod els As you discuss the UBA database contents, note in particular the following busi ness rules that arereflectedinthetablesandtheir contents: A paint er c an paint ma y paint ings. Each paint in g is paint ed b y onl y one p aint er. A gall er y c an ex hibi t m an y paint in gs. A paint er can ex hibi t p aint ings at more than one gall e r y at a ti me. (For ex ampl e, if a painterhaspaintedsixpaintings,two ma y be ex hibit ed in one gall er y, one at another,and threeatthethirdgallery. Naturall y, if gall e ries specif y ex clusi vecontracts,thedatabase mustbechan ged to r efle ct t hat busi ness rule.) Each paint in g is ex hibi ted in onl y one gall e r y. The last busi ness rule r eflects the fact th at a p aint ing c an be ph ysic a ll y loc ated in onl y one gall e r y at a ti me. If the paint er decid es to move a paint ing to a di ffe ren t gall er y, th e database mustbeupdatedtoremovethepaint ing from one gall e r y and add it to t he d ifferent gall er y. b. How migh t th e (in d ep en d en t) tabl es b e re lated to one another? Figu re P 2.1 0b shows the relations hips.

FI GURE P2 .10b The UBA Rel a tio na l Dia gra m

11. Using the ERD from Problem 10, create the relational schema. (Create an appropriate collectionof attributesforeachofthe entities. Make sure you use the appropriate naming conventions to name the attributes.) The relational dia gram i s shown in Figu re P 2. 11.

FI GURE P2 .11 The Rel a tio nal Dia gra m fo r Probl em 11

36


C hapter 2 Data Mod els 12 . Convert th e E RD f ro m Prob le m 1 0 in to th e cor resp on d in g UML class d iagram. The basic OO DM solut ion i s shown in Figur e P 2. 12.

FI GURE P2 .12 The OODM fo r Probl em 12

13 . Describ e the rela tion sh ip s (id en tif y the bu sin ess ru les) d ep icted in the Crow ’s Foot E RD sh own in Figu re P2. 13.

Fi g ure P2 . 13 The Crow ’s Fo o t ERD fo r Pro blem 1 3 The busi ness rules ma y b e writ ten as follows: A professor can te ach ma n y cl asses. Each class is tau ght b y o ne professo r. A professor can advise man y stude nts. Each st udent i s advised b y one p rofesso r. 14 . Creat e a Crow ’s Foot E RD to in clu d e the f oll ow i n g b u sin ess rul es f or the Prod Co co mp an y: a. E ach sal es rep resen tati ve w rites man y in voices. b. E ach in voice is w ritten b y on e sal es rep resen tat ive.

37


C hapter 2 Data Mod c. E ach sal es rep resen tati ve is asels sign ed to one dep art men t. d. E ach d ep artmen t has man y sal es rep resen tativ e s. e. E ach cu s tomer can gen erate man y in voices. f. E ach in voice is generated b y on e cu stomer.

38


C hapter 2 Data Mod els The C row’s Foot ERD is shown in Figure P 2.23. Note that a 1:M relationshi p is alwa ys read f ro m the one (1) to the many (M) side. Ther efor e, the custom er -invoi ce r elations hip is r ead as “one custom er gene rates man y invoi ces.”

Fi g ure P2 . 14 Crow ’s Fo ot ERD fo r the Pro dCo Co mpa ny

15. Write the b u sin ess ru les that are ref lected in theERDshowninFigureP2.15.(Notethatthe E RD ref lects so me si mp lif yin g assu mp tion s. For example,eachbookiswrittenbyonlyone au thor. Also, re me mb e r that the E RD is alw ays read fromthe“1”tothe“M”side,regardless ofthe orientation of the E RD co mp on en ts.)

FI GURE P2 .15 The Crow ’s Foo t ERD for Pro blem 15

39


C hapter 2 Data Mod The relations hips ar e bes t describeels d throu gh a s et of business rules: One publi sher c an publi sh m an y books .

40


C hapter 2 Data Mod els Each book is publi shed by one publi she r . A publi sher can subm it man y (bo ok) contr acts . Each (book) contra ct i s subm it ted b y one publi she r. One author c an si gn man y contr acts . Each co nt r act i s si gn ed b y one author. One author c an writ e m a n y books. Each book is writ ten b y one author. This ERD will be a good basis for a discussi on ab out what happ ens wh en more r eali sti c assum pti ons aremade.Forexample,abook–suchasthis one – ma y b e w ritten by more than one author . Therefo re, a contr act ma y b e si gned b y mor e than one author. Your studen ts will learn how to mod el suchrelationshipsaftertheyhavebecomef ami li ar wit h the material in C hapter 3. 16. Creat e a Crow ’s Foo t E RD f or each of the f oll ow in g d escrip tion s. ( Note: T h e w ord m an y merely mean s “ mor e th an on e” in the databas e mod eli n g en viron men t. ) a. E ach of th e MegaCo C orp oration ’s d ivi sion s is comp osed of man y d ep art men ts. E ach of d epFoot artmen as maninyFigu e mpreloyees assi gn edtoit,buteachemployeeworksforonly Thethose C row’s ER Dtsish shown P 2. 16a. oned ep art men t. E ach d ep art men t is man aged b y on e e mployee,andeachofthose managerscanman on lyMeg on e a d Co ep artmen t a otime. FI GURE P2.16age a The Crow tsaFo ERD

’t EM P LO YEE

is a ssig ne d t o

man ag e s

DEP AR TM EN T

As you discuss the conte nts of Fi gur e P 2. 16a, not e the 1:1 r elations hip bet ween the EMP LOYEE andtheDEPARTMENTinthe“manages”r elations hip and the 1:M relations hip between the DEPARTMENTandtheEMPLOYEEinthe“isa ssi gne d to” relations hip. b. Durin g some p e riod of time, a cu sto mer can r en t man y vid eotapes f rom the B igVid store. E ach of the B igVid ’s v id eotapes can b e ren t e d to man y cu sto me rs d u rin g that p 37 eriod of


time.

C hapter 2 Data Mod els

The sol uti on is presented in Fi gure P 2. 16b. Note t he M: N r elations hip between C USTOMER an d V IDEO. Such a relations hip i s not im plementable in a relational model .


C hapter 2 Data Mod els

’t FI GURE P2.16 b The Bi g Vi d Crow s Foo ERD re nt s

CU S TO M ER

VIDEO

If you want to let the students convert Fi gure P 2. 1 6b’s ERD int o an im plemen table ERD, add a thi rd R ENTA L enti t y to cre ate a 1:M rel ati onshi p between C USTOMER and R ENTA L and a 1:M relations hip betwee n V IDEO and R ENTA L. (Note that such a conve rsion has been shown in t he nex t problem solution.) c. An airlin er can b e assign ed to f ly ma n y f li ghts, b u t each f ligh t is f low n b y only one airlin er.

FI GURE P2.16 c The Ai rli ne Crow ’s Foo t ERD I nit ial M: N Sol uti on f lie s

AIRC R AF T

F L IGH T

I mpl e ment abl e Sol ut i on AIRC R AF T

is a ssig ne d t o

sho ws in ASS IG NM EN T F L IGH T

W e have cre ated a small Ch02_Airlin e database to let you ex plore the im p lementationofthe model.(Checkyour Instr uctor’s C D.) The tables a nd the relational diagr am are shown in the following two fi gur es.

38


C hapter 2 Data Mod els

FI GURE P2.16 c The Ai rli ne Da ta ba se Ta bl es

FI GURE P2.16 c The Ai rli ne Rela ti onal Di ag ra m

Solutions Manual for Database Systems Design Implementation and Management 11th Edition by Coronel Full clear download (no error formatting) at : https://downloadlink.org/p/solutions-manual-for-database-systems-designimplementation-and-management-11th-edition-by-coronel/ Test Bank for Database Systems Design Implementation and Management 11th Edition by Coronel Full clear download (no error formatting) at : https://downloadlink.org/p/test-bank-for-database-systems-designimplementation-and-management-11th-edition-by-coronel/ database systems design implementation and management 11th edition pdf "database systems design implementation and management 11th edition ebook" 39


C hapter 2 Data Mod

database systems design implementation els and management 12th edition pdf database systems design implementation and management 9th edition pdf database systems: design, implementation, & management 12th edition download database systems design implementation and management 10th edition database systems design implementation and management 8th edition pdf database systems: design, implementation, & management 13th edition pdf


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.