0% found this document useful (0 votes)
43 views15 pages

Database Final and Mid Exams

exam

Uploaded by

yisakyisak20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
43 views15 pages

Database Final and Mid Exams

exam

Uploaded by

yisakyisak20
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 15
r 10 | college (i Sur construction ple | $1 f 12 Mekelle university | $0 3 Raya beer ple 3 NB: GERRI in the customer table refers to the PREMEMIMM}n the location table Write an SOL statement for each of the following queries (1.5 pts.) 13. Find list of worker names, highest paid workers should be ordered first toy bacb Desc Saiect Ears, ternme Frery Wve Umma (or 14. Find out how many female and male workers there are taek caudstuser ies taveve tren Wavy OD count Cerensdev\ as MALL Svan paiayer Mtn 15, Find any customers who have an ending with PLC rca Gender, Re Gente edna ra ulrene, Curtorare CUsdiee¥. narra, Seach & + 1S 16, Find any workers bom in February Sith mw ttre reo Ken . Satect & trenMlorrer iarere, 'Grith dnte! petenencuttorra wrens, CUE Bett # fears ae s et Seto asad mess sane feggl 3 Seon Et Nar nent 14. Find lists of workers and customer nares Sold + Kear Wadocrays ¢ woes tb» fran Cunteney | D> 19, Find the total money spent to each workers as a wage ered form (istagel an etatienahfook fran Mtorber f 20, Find the location names and their bosses! Sata feast WAbhitebnrwene Locations inentiona nares Adavitek 4 LOWES tree, ieiey Moen Bo Coontisn Canta 3 aries fron CR niine trey. towne th 21. How many workers have coordinatars x PUsaihE hae 288? coroet (Koordientaih\ Azteva comvanntar-td nob 22. Find the customers and their location where they are handled Sete © RUA bald betas ih Eusrerars Cottomexneme , Loewdisa. Locating. Leanbien— nana, fr sr GENCE fers anniek IK bounion s wa mere lhemtion ba 2 Lous on a1Page ADevie each i the following activities to which cole it belongs. Use enatching (1/2 pt. each) 7" nn hi of “Ketiviies QO denigrate egnceptoal scheme a atipleniecenemsteals hina getae.ohinlipteen nmr DP Adandiai (LS To Managing user accounts hardware resources and back up during the life time of database “pplietca proprmnen F768, — To Programming of software that 18 using the database T Ghoies of DIMS 7 Analyge requirennent For the database © Programming of wser interface for the database 7 Gathering of information about the application field ~~ S” What ifthe ad\antage and imitation of database Approach? (2 pt. t uy sae cox 4a Choe, AOE OL fe nates Gyre rte ctenign mead REAE we CH donchne Od DE Ka LEKE Lovee AG site, pameged te: = Fatengtemey eat \ mediate Ooi. = Poly de acce ston = bor m Some fy is CO Mrniged md ahrdey dain indayorde ) 6 Wine the general eoncept of database approach as compared to tritioal file base approach, (2 ” We dole wy andeparded efron. mes OVEN cmd!» B Pertierr Win DRIAG Seftor YA dhe erat mo opp lita fy ete, gp bere \ Mono dota dagticatey (PT bpdede gq fried, devel Aran QPeradtass eve from Say tore we met tate, Wpdeds aad dete hurths mm tyegin doin loney @ tte « ao of Hes deive BA wee, comb Gowh os fie tome AM Que 5 enloaded M9 Wt Conn gh vr anche feet Ca ~e tae nye cpeeesshleay 2 awe Sige GA” «cade 0% Ve SL NOS cpa Gy, \ at ai t= Beal} 5 >} $248 . aj te ys. ) Schemmm etenint Ace dovten. Strict pd 1 dalatents Mele dann Ae ektog 5 ORY Craetoy , SONhy Tauern AAielnte 6S Dx dts oo dt london (orttesarec Arm soon cowie Si , Witt. toad 2\ Define each ofthe following cleatly with couples of examples (1 pe (A. PRIMARY KEY and FOREIGN KEY Bt. base and view relation c Abtegrity rules * ‘ 4 sre | he os BEL Neate bath o\umqany dedty Ae trogen Creeotss | Mi aim oh 06 FEEEEY wances a gore] my et penny Anko oy Ws a tige of reuntion nate odes ang sted te wy atypial velalien fo BRLRECS “edeh, aaa. dere penal Getter ek “et: a ' ton entity : om dag of orn © SechUCS USS oe pout iawn Zo Cage Oru 4 Be orien 1 dora interity , Oo sg ‘ : wn tepad 4d vith g Sere ee ee ee sv # ri s eae ee Oe Oe. emuery Btn maak sci i fey tame ate Ss bute wid examples? 9 pray Heh of mater sac q) (EB) Swrpte & Compost [tines rare any Sage Untues Feargl rms Sop alesis Age, £0% co 6 ig Eactan oS iA a Mea, Addvoss €t6 Gan) Singer Unwa BL emule: Utonie 25) Srmyt Meng yey mime, Sem , ta Ceparbrreak ss parton URES die piney | [ Aldvere iS TR Pater Van mae dies tea Myidect \ AD Bot stoned adie sca dh fe Bete deny Adana 7 grads — Mee Cer Lye Lintustbarsy Gop Sons Sony modivntus Wey moe te Ont Carne Mu Kae teas yo comeselle eo wes op (ote | pe Ray aa an i . eative-sh | bebietawr rig. L Pm tite tt Se) te Bin fi : l t 2 a none Lawes > define vheme and instance (1.8 pO Schema ittientnt toe dot. Dive doce he ety 1 OMY C Mylene 0S Oe dates mn dot Wade od (Coritesaiad 41m ghiacne of 1 daiabers amp ook ify SENG Pease tron asin . athe Sama ne a 2 ps eed ere ba ee 2\ Define each ofthe following cleatly with couples of examples (1 pt ‘A. PRIMARY KEY and FOREIGN KRY B. base and view relation Gs Integrity rules as-6F * 1 ee ig BE Bitte ween neganty detthy Ate agen veeects | Per de x ! ; gpa comet nb #6 BEREAN teh ta ovary he et Bo i PR baat datas ane seamed 1 Blaborremin bo tye of rete ae Ulan neintion 3 ture of reldinn 5 HERS Unie, on dooen & “\ ° Jreandiens (tietuad totus Cardved| ralertaly trors velaruer lon, eatelny in urhieky | belt ine Sina ate, tapes Sms Lopes pou soem pegs maths ores pe apt Vee ate dee pay es oe ms SU Mtoe “St eens eon ia dors Maat ea aoe tan bend 4M eit ality of relationship D. i ’ Sharp OE eee te ‘ - a Wa ape env BO mun © AF primary key of he cr ie “List the ditt ype of aiributes with examples? (2 pt) eee | ¥ GE) Supe & Comportd feiras hen any sequ Untuer [eargatl res Sop melsieeh ay Content Cy Mires — pga, Se ce be : ont a Nore, Addverd €F6 Ga) Sine Unwva BL emule: Utonss sags cnwus' hay Oawy S49 Smug watue We> mou dire one Gate Or Singh Sarwtig Age, Alma, S67 ws Cpontrenk os partin URAWB Lie pie. \ ( pldwese a WR Parien Was nets ote Magia \ AD Ber stoned achieve Toy Gis deny | Adadve 7 Ne Cer areas ADevie each i the following activities to which cole it belongs. Use enatching (1/2 pt. each) 7" nn hi of “Ketiviies QO denigrate egnceptoal scheme a atipleniecenemsteals hina getae.ohinlipteen nmr DP Adandiai (LS To Managing user accounts hardware resources and back up during the life time of database “pplietca proprmnen F768, — To Programming of software that 18 using the database T Ghoies of DIMS 7 Analyge requirennent For the database © Programming of wser interface for the database 7 Gathering of information about the application field ~~ S” What ifthe ad\antage and imitation of database Approach? (2 pt. t uy sae cox 4a Choe, AOE OL fe nates Gyre rte ctenign mead REAE we CH donchne Od DE Ka LEKE Lovee AG site, pameged te: = Fatengtemey eat \ mediate Ooi. = Poly de acce ston = bor m Some fy is CO Mrniged md ahrdey dain indayorde ) 6 Wine the general eoncept of database approach as compared to tritioal file base approach, (2 ” We dole wy andeparded efron. mes OVEN cmd!» B Pertierr Win DRIAG Seftor YA dhe erat mo opp lita fy ete, gp bere \ Mono dota dagticatey (PT bpdede gq fried, devel Aran QPeradtass eve from Say tore we met tate, Wpdeds aad dete hurths mm tyegin doin loney @ tte « ao of Hes deive BA wee, comb Gowh os fie tome AM Que 5 enloaded M9 Wt Conn gh vr anche feet Ca ~e tae nye cpeeesshleay 2 awe Sige GA” «cade 0% Ve SL NOS cpa Gy, \ at ai t= Beal} 5 >} $248 . aj te ys. ) Schemmm etenint Ace dovten. Strict pd 1 dalatents Mele dann Ae ektog 5 ORY Craetoy , SONhy Tauern AAielnte 6S Dx dts oo dt london (orttesarec Arm soon cowie Si , Witt. toad 2\ Define each ofthe following cleatly with couples of examples (1 pe (A. PRIMARY KEY and FOREIGN KEY Bt. base and view relation c Abtegrity rules * ‘ 4 sre | he os BEL Neate bath o\umqany dedty Ae trogen Creeotss | Mi aim oh 06 FEEEEY wances a gore] my et penny Anko oy Ws a tige of reuntion nate odes ang sted te wy atypial velalien fo BRLRECS “edeh, aaa. dere penal Getter ek “et: a ' ton entity : om dag of orn © SechUCS USS oe pout iawn Zo Cage Oru 4 Be orien 1 dora interity , Oo sg ‘ : wn tepad 4d vith g Sere ee ee ee sv # ri s eae ee Oe Oe. emuery Btn maak sci i fey tame ate Ss bute wid examples? 9 pray Heh of mater sac q) (EB) Swrpte & Compost [tines rare any Sage Untues Feargl rms Sop alesis Age, £0% co 6 ig Eactan oS iA a Mea, Addvoss €t6 Gan) Singer Unwa BL emule: Utonie 25) Srmyt Meng yey mime, Sem , ta Ceparbrreak ss parton URES die piney | [ Aldvere iS TR Pater Van mae dies tea Myidect \ AD Bot stoned adie sca dh fe Bete deny Adana 7 grads — Mee Cer Lye Lintustbarsy Gop Sons Sony modivntus Wey moe te Ont Carne Mu Kae r 10 | college (i Sur construction ple | $1 f 12 Mekelle university | $0 3 Raya beer ple 3 NB: GERRI in the customer table refers to the PREMEMIMM}n the location table Write an SOL statement for each of the following queries (1.5 pts.) 13. Find list of worker names, highest paid workers should be ordered first toy bacb Desc Saiect Ears, ternme Frery Wve Umma (or 14. Find out how many female and male workers there are taek caudstuser ies taveve tren Wavy OD count Cerensdev\ as MALL Svan paiayer Mtn 15, Find any customers who have an ending with PLC rca Gender, Re Gente edna ra ulrene, Curtorare CUsdiee¥. narra, Seach & + 1S 16, Find any workers bom in February Sith mw ttre reo Ken . Satect & trenMlorrer iarere, 'Grith dnte! petenencuttorra wrens, CUE Bett # fears ae s et Seto asad mess sane feggl 3 Seon Et Nar nent 14. Find lists of workers and customer nares Sold + Kear Wadocrays ¢ woes tb» fran Cunteney | D> 19, Find the total money spent to each workers as a wage ered form (istagel an etatienahfook fran Mtorber f 20, Find the location names and their bosses! Sata feast WAbhitebnrwene Locations inentiona nares Adavitek 4 LOWES tree, ieiey Moen Bo Coontisn Canta 3 aries fron CR niine trey. towne th 21. How many workers have coordinatars x PUsaihE hae 288? coroet (Koordientaih\ Azteva comvanntar-td nob 22. Find the customers and their location where they are handled Sete © RUA bald betas ih Eusrerars Cottomexneme , Loewdisa. Locating. Leanbien— nana, fr sr GENCE fers anniek IK bounion s wa mere lhemtion ba 2 Lous on a1Page 1 Drips toe pensibie lopeat denign using relational data wedel. Clearly show the Possible ‘wes thet cory oi thn son West UL Uae the three tates cure born to unemer the Styt. questions Werte § Ve {A pee [ Waye [Gator {Wath date Vente Medinah imaanié | | \e i (iT cas at aa tiara i a thigpah | win a Lona ris tne alee Ta Tinacar 2 Yemen + eee apron Part ls pat the tett ‘Eri si a ses mel th gine ‘is true and letter “Y" ifthe answer is fase (I pt each) 2 Lowhly bise tables are Physically stored il ra the strong entity that has relation with a weak entity, we have also to delete the 4. XThe number of entities Participating in a relationship is ionshi : ipis called the cardinality of the relationship. S. Y.A-stper bey is an attribute, or ser of attbutes, within one relation that matches the candidave key of softe relation. 6. bonceptual design is a process of, based on a specitic dats mode 1. &.BMterprise constraint of a relationship is involved in ‘dentifying or setting the mandatory or options! fearure of an eanty to take a role in a relationship, a 8. EsphYsical design is logical design adopted to particular DBMS 9. Y.. noriqalization steps can eliminate data redundancy and the risk of data becoming inconsistent. 10. ¥.A table (relation) ts in 2NF If It is in INF and there are no transitive dependencies between a ‘constructing 2 model of the information used in an enterprise 2 Fant: Consider the following Data Requirements for a new enterprise to answer the Who manages it. The enterprise makes its income by selling items tof Each agent has a.pame and a unique puipber ta identify it. The enterprise has severalfemployees) Each employce has a name, Lurtbday, sex salary and a unique cumber. 4p employee can wotk for one siteata time, and one of {e.emoloyers that work there will manage each ste, We will also want to keep tack of when the current sted as manager. An employee can act asa leader for other employees atthe sit; x an employee may also act as the leader for employees at other sites. An employee can have at most Kuso ‘one leader. A sité may handle a number ‘offagentS) with each agent having a name and aunique number t 10 identify it. A single agent may only be handled by One sitt)ar‘d time. "Employees can work with Hs 9 unique number, a name, and a specific employee ta ofigents, ¢ agents controlled by their site to sell therm items, If nece3eary, multiple 2mployecs dan work with the a, \ \r same agent. We will want to keep track of the amount in birr of the item each employee sells to each Sen " agent they work with s atk 3 LL. Desiga a posnble conceptual design using ERD (Entity Relationship Diagram), Clearly showing mh all the objects, attributes, constraints and the cardinality from the above data (15 pts.) Ate iD \ Poa + Sine A[Page a ar Ae Contegion + tro dos WO tory (a) Departement op gftware Engineeriog Frundameraais of atavare Cos + Student Addr tate, city, stee 2. Define each of the following (1/ A. PRIMARY REY 6 Sc What is the edvantag © Write the general concept approach, (1 pt} r eo customer ts 0 ‘Adous university college (i Sur construction ple 12 Mekelle university | 50 1h Raya beer ple 33 _] Write an SQL statement for each of the following queries (1.5 pts.) 13, Find list of worker names, highest paid workers should be ontered first ‘b Saiect Ennre, terre Fray (oyna Wmmame Godoy 14. Find out how many female and male workers there are a serect couct teins Tammie froin lovey tairere Gender, si Meek AS Cenenedev es Mane fens paige laters Gendt 15, Find any customers who have an ending with PLC f inet vd RO? tlrene Conercare Cot Selah & fren Cr 16. Find any workers bom in February Satect & wemMlorrer mabere, ‘Brite date’ = pe Stwh# sermmmncusionas wreet 17, Find any customers who ate unpersties. + . : esses SAdwas Universi] Cotte Seised & frame Ruka, Galera a mane ener Se ee Grgrrattenmmae * Nast on terse R 16, Find lists of workers and customer names Scie dS © Loner Wlawrers SS MUSA o Fone Cmrtened l » 19, Find the total money spent to each workers a& a wage Taek tum Ctavege\ as Matsa efook racy blevkeX ok 20. Find the location names and their bosses / Sein UAbbtcbrrens Lorntions Loenttinnnacs MAVEN | Type, Wishes ipmth ders Ulornex D4 toendior Basa a 21, How many workers have ecordinators , UE Dee 2819) cried (dooudtiontr rd) Astbeva, comvemntay-t & nab naw re é t terme Fron Leiniine orev. ewes rd 22. Find the customers and their location where they are handled Seiect © MUAtAbantdeabtetasi ids Cortemars Cartomex nome , Leewitaa. Locating. Londien—nana, Fven tk ee mere lOemsion td © Lows phe Loention «88 atPage Pare I pat he letter *E* bff bles are logical entities 2. Lowily base tables are physically stored € : lr the strong entity that has relation with 4 Weak entity, we have also to delete the 4. LThie number of entities farticipating na telationship is called the cardinality of the relationshi S. Y.A-stpes Sey is an attribute, or set of ‘buts, within one relation that matches the conde Key of softe relation. 6 Y..bonceptual design is a process of constructi based on a specific data model. 6. Byterprise constraint of a relationship is involved in ider Prenat estate of an entity to take a role in acelatonship, 8. Ephy letter “Y" ifthe answer is false (L pt exch) road sla ltainate data redundancy and the risk of data becoming inconsistent. {tis in INF and there are no transitive dependencies between a Primary key and non-primary key attributes Fan it: Consider the following Data Requirements for a new enterprise to answer the following questions The enterprise is organized into sites, EactHSTehas a ynique number, a name, and a specific employee Who manages it. The enterprise makes its income by selling items tofigent; Each agent has a pane and a unique puinber to identify it. The enterprise has several Eisployees) Each employee has a name, lubday, sex, salary and a unigue qumber. Ap employee can work for one site at a time, and one of oyees that work there will manage each ste. We will also want to Keep track of when the wnager started as manager. An employee can act as a leader for other employees at the site; an employee may also act as the leader for employees at other sites. An employee can have at ron ‘one leader. A sité may handle a number ‘ofagents, with each agent having a name and a unique number to identify it. A singlé agent may only be handled by One sit®)ar‘é time. "Employees ean work with agenti controlied by thei site to sell ther items. Ince, multiple Pmployees dan work withthe same agent. We will want to keep track of the amount in birr of the item each employee sells to each agent they work with, » A 11. Design a possible conceptant design using ERD (Entity Relationship Diagram). Clearly showing \.t the qhjects, attributes, constraints and the cardinality from the above data (15 pts.) \\rgpn ey Gir ak 1[Page bax aw corse plvoo\ mat topyen\ dos, QO Ca moh corres 12 Design te pensibie lopeat design uaing relational data edet. Clearly show the porsible Swen that oory vist wher comerting the ERD into relational tables. Follow the rales used in athena aber 110 pte.) hae nen «Pert It Ue the three tabi shown halon to antmer the Syl queetions a Woshag fo - au Joukoaai\ ie i Waye | Gondor | Thath date LC f Vorndet Sadia 100 linaanie } } 4. 4 4 (ii | Wiothads~] Wiakere “saa [isons i =: Iisinysad ain tiv cea. tee Rives) Aaa Titsinai 2 Yeweenee + eee j nia | wininon | iia | iene | avon A Devi ea if the following activities to which cote it belongs. Use enatching (1/2 pt. each) vnesingensin—gnnerpeneenpprnrnnr erg pecan PA ‘Ketivities 1” Developing the epneeptual schema fn} Do Managing user accounts hardware resources sed back up during the lifetime of eatabase Programming of software that 18 using the database 577 Gathering of information about the application field 1S WHALE amage and Tamia of database Approach? (2 pt) ey are > a copt and wan 49 Choe $C Od te naus Cyele = Redaideny Ve Hee Ti amginde ang md ROR “i MiasestAsp SGN oid we CoQ domehin? td ERB EM Loreen Spreriny det AGS Vier Bowel dires ae = tatenatsiney mts d \ wm Redhstt Q SeCine = Pov( do acce oat Fonte oe iy, CE Hrnlged avd wtinday daty indapoide ) 6. Wrkte the general concept of database epproach as compared to traditional fle base approach. (2 me a te dole os rrdepadert froms mates mOpei ond! s fertrer vim DRAG Seffuars Wary then Criatey mr ogy tain fy ee p EeEN Bono dota dogtionte \ APT bpdede g fried dere Cigtanus OPeradtecs ove aranke cay tore we mt aay, topdely avd ceied harks yegin doin loney @ wit He Gore BA we. coat Gwh os ctu af fice toms, Aor fie 5 inwedud OF COOMA Fa we. Comeok ve ove} ¢ wp SAR | brecbotet ase , Pm a tirn, | a Bingen. 7 zg tales ~ ae Wine Allowed: Exahod foetal Deum sein: Mat P< define schema and instance (1.8 pl) cate of 45 dalalors Fat Schern aktentnt. Ace desten. Str conte | RED, Conpeet iy» SARE taut tre: od Cordtesa tee ten | | ; 1% bans boven Ae pi nd Wvikentt 0 Oe dates my isin _gask.Snrathe L Sens Fs AS Toss é 2 \ Define exch ofthe following cleatly with couples of examples (1 pt EIGN KEY B base and view relation C. Q Ae PRIMARY KEY and FOR! Antegrity rules sas Dex remy | hed 18 BR Dette tate o\ um query § ob RREAY wien OA Zr wy abe 0 de A hatte . i Dy tata thy Aotay ong Ste & “phe dehy Ae hog Creer | rem] Fey eb Bet #F fey Babar bo tye of rem Ana ees dikes qn dese Arem bee. ata\ien aol weak ‘ sy tan tatty im tothe hy obael: bem, vetate fl So pena, euity dopeb 7 (ering ol omnis @ ee tua w-5 or Triage: monaute Oh pee Hey MACES, dorrncn fabaeity , Extitt BS wen betend AM eit m Ua £1 cordicov| va OE crmean iecoes narra a Lorne wa mee Am peer Bey od meter sy de 1. tine cite ees OSes with examples? 2 PO i CE) Srp BR Commport h [teas rons Cy tps Age, 60K se (4 [eargatl res Sop oles AH aot lene, Addva rs EE Gan) Smye ane aL amit: tani | SAS Aa Baty “Shey SN Alg rehash o none try one Gare ay Segue Untwer , Dy Cotten K_MOSUN gy Age, Alone, SCA n gay. s Qari WAS Le pieces \ ee eae MENGE | ae Ckpont erent YR Qertan Vann Ke Ataniae GAD Bor stened ackye ca s ; qruas, q be Bote dey dave’ Me. Cert

You might also like