0% found this document useful (0 votes)
62 views61 pages

Akash

akash book dbms

Uploaded by

Forcra Ck
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)
62 views61 pages

Akash

akash book dbms

Uploaded by

Forcra Ck
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/ 61
SYLLABUS DATABASE MANAGEMENT SYSTEM (CIC-210) Applicable from the Academic Session 2021-22 Marking Scheme: 1. Teachers Continuous Evaluation; 25 marks. 2. Term end Theory Examinations; 76 marks Instructions for paper setter: 1, There should be 9 questions in the term end examinations question paper. 2. The first (1st) question should be compulsory and cover the entire syllabus. This question should be objective, single line answers or short answer ty)" pu tien of total 16 marks. 3. Apart from question 1 which is compulsory, rest of the paper shall consist of 4 units as per the syllabus. Every unit shall have two questions covering the corresponding unit of the syllabus. However, the student shall be asked to uttempt only one of the two questions in the unit. Individual questions may contain upto 5 wub parts / sub- questions. Each Unit shall have a marks weightage of 15 UNITI Basic concepts: database & database users, characteristics of the database systems, concepts and architecture, date models, schemas & instances, DBMS architecture & data independence, database languages & interfuces, data modelling using the entity-relationship approach. Enhanced ER concepts - Specialization/Generalization, Aggregation, Mapping of ER model to Relational Model. SQL - DDL, DCL & DML views and indexes in SQL. Basics of SQL, DDL, DML,DCL, structure - creation, alteration, defining constraints - Primary key, foreign key, unique, not null, check, IN operator UNIT II Relational model concepts, relational model constraints, relational algebra, relational calculus. SQL- Functions - aggregate functions, Built-in functions - numeric, date, string functions, set operations, sub-queries, correlated sub-queries, Use of group by, having, order by, join and its types, Exist, Any, All, view and its types. Transaction control commands-Commit, Rollback, Save point. UNIT Il Relational data base design: functional dependencies & normalization for relational databases, normal forms based on functional dependencies, (INF, 2NF, 3NF & BCNF), lossless join and dependency preserving decomposition, normal forms based on multivalued & join dependencies (4NF & 5NF) & domain key normal form. Properties of Transaction, Transaction states, Transaction Schedule, Serializability, Concurrency control techniques, locking techniques, time stamp ordering, Recoverable schedules, granularity of data items, Deadlock detection and Recovery, recovery techniques: recovery concepts, database backup and recovery from catastrophic failures. Database Programming - control structures, exception handling, stored procedures, ‘Triggers. UNIT IV File Structures and Indexing: Secondary Storage Devices, Operations on Files, Heap Files, Sorted Files, Hashing, Single level indexes, Multi-level indexes, B and B+ tree indexes. Concepts of Object Oriented Database Management systems & Distributed Database Manegement Systems SYLLABUS [Academic Session 2015-16] DATABASE MANAGEMENT SYSTEM. (ETCS-208) Instruction toPaper Setters: Maximum Marks: 75 1 Question Na 1 shouldbe compulsory and cover the entre sys. This question should hace abjective or short answer type question. shouldbe of 25 marks. 2 Apart fom Nu at of th papers cos of fat a po haa Enery unt should have to questions. Hoterer, student may be asked to attempt only 1 question from each unit. Eack question should be 125 marks UNIT Introductory Concepts of DBMS: Introduction and application of DBMS, Data Independence, Database System Architecture ~ levels, Mapping, Database users and DBA, Entity - Relationship model, constraints, keys, Design issues, E-R Diagram, Extended E-R features- Generalization, Specialization, Aggregation, Translating E-R model into Relational model IM, 72] INo. of Hours: 10] UNIT- Relational Model: The relational Model, The catalog, Types, Keys, Relational Algebra, Fundamental operations, Additional Operations-, SQL fundamentals, DDLDMLLDCL PL/SQL Concepts, Cursors, Stored Procedures, Stored Functions, Database Integrity ~ Triggers. (72, R3) [No. of firs. 10] UNIT- Functional Dependencies, Non-loss Decomposition, First, Second, Third Normal Forms, Dependency Preservation, Boyce/Codd Normal Form, Multi-valued Dependencies and Fourth Normal Form, Join Dependencies and Fifth Normal Form, 112, Ri, RSIINo. of Hrs. 10} UNITIV ‘Transaction Management: ACID propertics,seializablity of Transaction, Testing, for and concurrency control, Lock based concurrency control @PL, Deadlocks), Time stamping methods, Database recovery management. Implementation Techniques: Overview of Physical Storage Media, Bile Organization, Indexing and Hashing, B+ tree Index Files, Quary Processing, Overview, Catalog Information for Cost Estimation, Selection Operation, Sorting, Join Operation, Materialized views, Database Tuning, (71, 72, RAJINo. of Hrs. 12] i NEW TOPICS ADDED FROM ACADEMIC SESSION 2021.22 ONWARDS, FOURTH SEMESTER DATABASE MANAGEMENT SYSTEM [CIC-210}, Q. What do you mean by the Heap Mile Organization? Ans. Heap Filo Organization = Heap Fie Oreation wore sh sata Yawn In this method recards ate inzeried at Whe end of the le sta the data Wa Se sere ng ‘or Ordering is required in this method, Ha data block cs fll Ue mew reruns sage some other block, Here Uhether dats Bock nerd tot be the very meat data ticek ah can be any block i the memory. It «the rexpunslity of DUS to the new records nd mate Insertion of new record ~ Suppose ww have four records i the heap. Bs [R6 and 1 and suppose a new record I has to be inserted i the beup then tne the last data block je data block 3 is fll it will be inserted in anf the data Macks sine by the DBM we want to search, delete or update data im heap fla Organizatian the we wa traverse the data from the begraning of the file tll we gut the requested rood This the database is very huge, searching, deleting or updating ube reeard ws take «be 2 syllabusx.live a —~—S—s&_——“ skaah Bona ao0-3 root, elty? Qt. Emplyce (emplayee-namesntroots ; orks employee-nmmeveompany-name, AIA Company (company-name, C19? on Consider the employee datnivar “Atgeben for cach of the followinw awerien, Oe sfalcmplonees whe werk fr SIL oF he lag ntdene af ellompovern who ware fa end qaployece inthe database who do not work for SIL eoreginy thedatabadowo that Hari now lives in Pune. Coast al capes in the works relation for employees of SI, lovee sane ‘eo “SBI (works?) se pte at supa name « “SI (worka ace SBF wpa (ox employee: nam. {er employes name Coumpany (Hh UPDATE ity Set City = Pune whore emplayee-name = Haris (DELETE PROM WORKS WHERE company -name = SBI; syllabusx.live SECOND TERM EXAMINATION [APRIL 2015] FOURTH SEMESTER (B.TECH) DATABASE MANAGEMENT SYSTEM [ETCS-208] | Time. Hove mvs0 | attempt QL iwhichsscompulsoyond nye mare queso rom remaining | Q1.Fitin neianas. . «io | tha ta) DONP stand for "Buses Normal Frm "4 aan Go PLSQL sands or Poedural Language Siactared Query Lanewss’ | ‘te vermont toi ee Mey Data em can be lake in Excuse ode where data stem ca be bth wodaieales ori ye ae, : Wy yey caxcading raltack a modified proto alled sii wo phase Wk Si anon must bel al sexe okt commit Sew "tn (0 Asenaltbeschedle sone where foreach puro ransctionsT and ae ae uly writen Ty the somal operatians oT appears Ste te eon perton hag. g)w timestamp) the Laat iestamp of any transaction that | coos trie roel ' hae (hy ANMIVDS yin Riscaleda il MVDs ifa)y ita subsctofXer(b) xe jh ( Thomas ite rule makes ve of view serializable by. infect, deleting lusts wrt operation fm te taneacions that ue Chem (0 Aas: ISOPEN alae returor FALSE fr implicit cursor, bonus Oracle cone the SGL coor stoma afer exeting its assated SQL statement relation = (A, B,D, B) with the following FDs: (CE » o (@) Find alleandidate keys. Ud) dentiy the best Normal Form that R satisfies (INF,2NF, SNF, or BCNF)) did If the relation is not is BCNF decompose it until it becomes BCNF. © ‘Ans. (0 Candidate keys: CE, CED, BCE, ACE (io Risin 2NP but aot SNF. (ii) Both D-+B and C+ Acause BONF yiolations. The decomposition: BD, AC, AB (obtaining) by first decomposing to AC, ABC) is BCNF and loslers and join-preserving. Q2.(b) Write down the syntax for creating triggerandexplainit. (3) Syntax (CREATE (OR REPLACE) TRIGGER trigge-na (BEFORE/AFTEW INSTEAD OF} (INSERT (ORY UPDA’ | en REFOREA \TE (ORI DELETE} {OF} ‘Aa. Th potas fr renting a rene | LP University-(R Tech)-Akash Books [REFERENCING OLD AS O NEW AS NIFOR EACH HOW} WHEN (Condition) DECLARE Declaration: statements BEGIN Executable - statements EXCEPTION Exception - handling-stavements END, where (CREATE (OR REPLACE TRIGGER trigger-oame: create or replaces an esting trigger with the trigger-name. “> (BEFORE/AFTERANSEAD OF}: This specifies when the trigrer would be cexceuted, The INSBAD of clause is used for creating trigger on view > (INSERT (ORVUPDAT[OR/DELETE!: This specifics the DML operation. = OF Cot-namel: This specifies the column name that would be updated. (ON table-name}: This specifies the name ofthe table associated with fife trigger = [REFERNCING OLD AS 0 NEW AS nl: This allows you to refer new and eld values for various DML statements, like INSERT, UPDATE and DELETE. = [For EACH ROW}: This specifies a row level trigger, ‘the trigger would be executed french row being affected. Otherwise the trigger will execute just once when the SQL statement is executed, which is called a table level trier {= WHEN (condition: This provides a condition for rows for which the trigger would fire. Thie clause is valid only for row level triggers Q3. (a) Explain the two deadlock prevention strategics. Which of the ¢wo steategics have fower rollbacks. o ‘Ans. Techniques Used: Ifa transaction, Ty requests a lock and the transaction, ‘D, holding a conflicting lock, the lock manager can use one ofthe following techniques: (waite wound - wait. ‘Wait Die Scheme: IfT has higher priority iti allowed to wait ele itis aborted. ‘This means that when Ti request for a data-item tha i currently being beld by T, ben 1s allowed to wait énly it has a timestamp smaller than that of, i older otherwise, , i rolled back (dies) * For Example: Say T, requests fora data item eld by, ang, also requests for i8-s a item held by Ti. 1, requests —s fF] — 7, recent Wound-Wait Method: 17 transaction has a higher priority then we abort eae ‘Ti wais. It means that when Ti requests a data-item currently held by T), then Ti is allowed to wait only if it has a Ts (Ti) > Ts (Tj). Else Tj is rolled back For Example: If T1 requests « data-item held by T2 then the data-item will be prescpte from T2 and 2 wl be rlled back Le, nomevilabusx.live wi) ‘The higher priority transaction ney ahem ere ere See | mtr ny ea) SS an baoeeinny eA naa stat hathes schedule is seriizable or not. schedule is seralizable, writ oa the equivalent serial schedule. RIC, R22), RUZ) RI, RS (1, ‘Ans: Its serializable schedule because ‘TY only reads X (RICK, which snot modified either by T2 or TS 1+ T3 reads X (RIK) before TH modifies it (W100. +72 reads Y (R2(Y) and writes it (W2(Y) only after T3 has written to it Wx) “Thus the serlizablity graph it ‘Schedule is not seralizable schedule because *T2 reads ¥ (RACY), which i then read and modified by T3 (W3IY)) +73 reads ¥(R3 (1), which then modified before T2 modifies ¥ (W2C¥)) 2 modifies YIW2Y)) mn the above order T3 interferes inthe execution ofT2, which makes the se sonseiizable o ] 100, WS (0, R2.00 W2a), Waqy @ 4. (a) Given the folowing oe of Fv UBC, DO AE Bee FD efor arelation R (A,B, C,D,E,F), B= Sooo til Sot 98. mt oe vera | “Taine eee | ‘snco "a sane may Sk ee seo _ ssase ao AB + Ge ae. re i | | LLP. University-(BTech?-Akash Books 201567 BoB osc D+D AB+C i) Fy, the restriction oF to(B, C,D. EF) De+E E+F BC -» DEF E+ BCDEF BC+ EF +00 BoD EEF B-sCDEF Bcd BoEF Bac BoB Now. (Fv Py easly sen to contains all set of FD which ha given. queion, So, cet all FD is dependency preserving decomposition “G4. (8) When a transaction is rolled back under timestamp ordering. itis assigned waew timestamp. Why can t not simply keep itsold timestamp, (3) ‘with the same timestamp, Whlhave be rolled back again. This will eontune indefinitely. Ife rollback on a transaction occars, when that transaction is resubmitted, it = spew transaction. Any automatic processes are going to recognise that and apply Dew wejuee Ifyou want a specifi value, you should generate it yourself using » different Tunetion and then reapply it with the new transaction, abusx.live pl JUNE 2015} ‘TERM EXAMINATION (JU? ) ENT OURTH SEMESTER {B.TECH] ATABASE MANAGEMENT SYSTEM D: [ETCS-208] Time. ours MM 35 ‘Note: Attempt any fee questions including Q)No. 1 hich is compulvory 1. Answer the follwoing question in brief: {Q.1-(a) List few application of database Management system, (2.510435) ‘Ana. Databases are used to old administrative information and more specialized such ax engineering data or esonomic midels Some of the applications ar + Compotered library system «+ Plight reservation systems + Computerized parts inventory aystera * May ots nage unt awn cn of abpage ine database aon QL. (b) Use Armstrong's axioms to prove the #0 oe prove the soundeness of the pesudo ‘Ans. If a+ holds and y+ 8olds. then ay -+ holds Q.1-(e) Write down the functions of DBA. ‘Ana. The main functions ofa DBA are as fllows: * Defining Conceptual schema. + Phyrical database design. * Security and intogrity checks * Give backup and recovery strategies, * Granting acess to users. QL) Describe the principles of Mutual Exclustion? Ans Mutual exlstion i variables pied wo crite] sections control the acess to ‘+ Aproceas that halts in its non-critical motion, oa t Procese requiring acess wo artical section Gat tobe delayed indefinitely. ‘+ Av long as no other process sina rita ‘must be permitied to enter witout delay nn meee tat quent entry om poe *Netunpon mde sot a pra pee be ‘Process must exit its critical section in a finite amount of " P Q1. (e) What is query processor? x means a rt Tange of activites involved in extracting data form LP: Universty-«1)Tech-Akath Boke 213-9 aa anriycocatzants provide a may of eomuring Une ears sade a ee ed ere do ot real eof ei eoucaogs WSS SE east with Be meee Seeneen ee Stanbutes form a candidate hey forthe eBUity set deadlocks? vey What are che probleme cause {1 at ee ua stoned eyed oan Pett ark whl wuiting ate ck LE a commomennanofpertormanc ble (ea tin nares em, paral em ‘ i ages? ea envio What ae is advantag a veered asthe logical ables of data extracted rom exiting cad ire me alt sot oi any ih rack Advantage: 1 eames daa without staring the data nto te object oi ener fle, ca hie sme ofc in te tablen ei or mor ables and show it as one abet 10 UP Mae nec of abv tat mabey can tert he rows it he table were hat are th various typos of fallures that can occu in databese? ea nee rrpany diferent type falae that canal database proven So Ta a amemory any, while ocersinvave on-ralite eeondary Sita Among th unc ofr ae: “sytem Crashes | 3 User Err Careless sabouage international corruption of ata) Statement Failure 7 Aplieation Software Errors 3 Network Failure | Media Paitre 7 Natural Physical Disasters @2 (a) Give the relational schemas: ENROLL (0, cf, section) represents student number TEACH (prof, c#, ection) -c¥represeates course oumber ADVICE (prot, s#)-profis thesis advisor of=# PRE-REQ (ct, pre_c#) - Pre_ct is prerequisite course | Guaves se, ce, grade, year) STUDENT (st, sname) -aname a student name. Give querie expressed in relational algebra or tuple calul forthe foDowing algebra: Lis al students taking course with Smith or Jones. isc aonomanaceniatme = DUSK VE (25x4e10) = 4 semester Database Management System i ° ent J rm student John’ can enroll i. has pay Tw men me cet * ag quis cour ' a orth ENOL TID venue opr > cTEACH ¢ ENROLL Nt STUDENT) iui) pro TEACH PX ADVICE pd ENROLL) ce same» J (PRE_REQ pf STUDENT x ENROLL) 2.14) Explain the normal forms due to functional dependencies, ‘Ans. Fire Normal Form (INP! Arai sad to bein INF ifand nly egy nur fthe aio ha at most single rao) vale ony ‘Second Normal Form 2NPY:A ration Rin second Normal Form (NP). fang uly tt INF an every on-keyatbute ily dependent onthe primary key ‘Third Normal Form (NPI: A relation Rie Third Normal Form GNP) tang eniy ifs 2NF and meno prine attributes ranstively dependent onthe key ro an say that non-prime attribute funcionaly determines any ether non-prmg attnbutere Fourth Normal Form (NF: Arelton Risin Fourth Normal Form ANP) fad nly tin NF oc BCNF ant contains no mul valued dependences Filth Normal Frm (SNP: Alton Risin fit Normal Foran SNP and only ANF and itcannut be further nose decopoed Q.3. (a) What is functional dependency? Write down the rules for fin {implied functional dependent froma st of given FDs. ‘Ans. Functional Dependency (FD A functional dependency an asosiatia cence wo attrbutesofthe sane table rlatn! Onvofthe altrbate vealed en deternant and eter atinbute i called athe dterned Note: Far each value ofthe determinant there is wssoni utes Fore terminant the ted one and Gay one value atu Rules: @) Refexivity Rule: [fu is wet of attnbutes and attr a then a + holds, (Gi) Augmenta aig,” Avementation Rule: fu» hlds,andw east attributes, then v +e (Ty Rae led enh nad (és) Complementation Rule: Ifu-»f holds, then a + +R B i (eb Replication Rule: Ia -+ holds then u-+ +, in Coalencence Rue: Ifa-+s bale andr 2 bald tis Difference Ru asa belde Gia ty BenlainGonealzatgn and seriaiaton wih stable cramp () vax Gemcaliations nadine a the proces feng we mien Generalist vlad reatng «ore eyo tena charting these comtian fares Tt can els be defined a the res ents proces he emcee yweting Dat can career Tenino atbotomup post 47 whee he sbi Boy epee can be generalized ita oe eral wpe base clase) named as VEHICLE, Example: (ere J lercomet 4) j (ox) (eus} Lome] | tization: tn dtined ste pre of ening wants ow et Supe rege that sare ee itnguhing characters Ite rose ae erp harer Level entity act to fr lower ent neta and acy speculation True opedown proces of eins euper-dane and their raed wae. Aol tat we Bry defn pera en sb-dane and en hi aban se intone The advantage of dong eneralaions casa saareeseeaiueoraub-enutis cam ave Une atihuer ei ewn. Jes fa-+-aPholde anda + + holds then a» «fe bids aud Hectreae is syllabusx.live bal semorter, Database Management Syxte “losure ofthe following tet & of functional depencigg 6) 12.2018 Fourth a) Compstethe tor Shtlanccheme to B.6,D.F hue cok BoD BoA Liat the candidate Keys for Re A-+ BC, SoA Band A» C ‘A-s Band B + D,SoA-> D (Transitivty rule) A-sCDand CD-»E,A-+ E Wnien, decomposition, transitivity rule) Sue A-+A,we have refleity Rule) [A-+ ADCDE (UNION Rule) E-+A.B-+ABCDE (Transitiety Rule) (CD -+E,So, CD + ACDE (Transitivity Rule) B-+Dand BC-+cD BC + ADCDE (Aujum ‘Tranativity) ‘Alaa, CC, D+ -»D, BD -+ Dand so on Therefore, we find that any FD with A ,DCor€Dan the LHS of arrow nin Fy atthe FD Say" Emcertnan F inthe FD Say*,roprownts any set of attribute ation Rule & BD +B op sD +c Dod DD + BD BoD Bon fand all FDs of the form ae Where «is eny subset of A,B,C, D,£) Deana haar AD, ED ad ising the FDs of shove Fig, jeover, hon Gee error efabore FIT, Find the canonicalcover Ret (6.8) Ase cD +8 Bop LP University- (Ih Teoh Akash aks wisay 5. Draw an E.t diagram for a garment manulacuring company. The entities Include warehouse, production unite, marketing wing vendor and product types. Dofine the relationships betweon each of thew entities. Chowne the atteibute hat they define a particular entity property ‘Ana. Refor to Q No ¢2)(a) frum Firat Ter Examination, 2014 (046 4) What the deren betmeen sera schedlr wad yeiarale wdc? Aanta, Refer Qos of Fat Lem protocol haved on read and write os 6. (b) Formulate « concurrency cunt locks. ‘Ana. Mainly thereare two protocale uned | ng (2PL) protocal W) Timestamp gnleriny protocol (O Twophase Locking Protocol: Ill lcking opeeations prevele the rst ai, aperatianinthe frapenetion then a transaction follows Ue two phase ling rs PI. hus two phases in d given achedule axe: A phase during whi equation ce bo 7 “Giowny” Locked Seman hace phase pha 2 scene Ud) Timestamp ordering Protocol: This protocol works on a principle thal» “We ‘ust haven prior knoweledge about tho onder in which the transactions willbe arcremed” Tn graph based protocol, we require the knowledge of ordering of data wean the transactions. ‘Timestamp have two propertion: (a) Uniquonoes: This property assures that no equal timetamp values can eset (b) Monotonetty: It means that timestamp values always increase, What timestamp ? Discus the working af wait dt and wowed ait art "tna a. Refee Q/No Ma) af ssa) tem 2416 ad’ NO A ura Join wth Over dln wid table mmole 69) ‘Ana. Natural Join: Natural join between two relations i wrtien aR 345) reat ofthe natural jin inthe Bet ofall combinations of taplag so I and B that are coulenier enmmarentes = SyllaDUSK.live ES © nd ern 2017 Q7.() Compare Nat . our Semester, atabace Management Sal 1 tas oe oe tl Sock tea go teh Por Panmple Coir th tabs Eo wero Toparement ables are retained ployee and departme Papier = [Esp id [tee td RiwnatT et | €or | | Kava | eo2 | eos | | Aped | eas | aor LAruna{_eoe | oz | Mesult of Natural Join: Pmplovee De Department [Nese [Hip 1a] Dept td [Dept Wiank]} eal | 40) | Pnanow [Kamta| soz | aot | Satew to Ape | 03 | 401 L_satee | Rewult of Outer Join: Employee pg Departmeas ‘Rane [Rasp 1] Dep aa eee | Keene | ec2 | dor | Seon [fs] Se | Sg loae. Aruna | oe | 402")! List saul a | weline| 94. Explain the foeving ferme: oat QA te) Pourth Normal Form, 4 ‘Ane. Fourth Normal Form: Ailton oy ithe flowing condone are saad sie 4 Raready in NF or BEN ont 10 multi-valued dependeocis. Example: Connie the lowing emp signed mite proecta Ale assure, ianewusly ‘that employees can have nt cur ul the rows returned by doin An outer pin operations Ts rue ligd a ered mt match any row fr he ter al. Any (25.5125) Fourth Normal Form (UNF) and lye table Suppose that employees can be tuple job skill. a ce sd thei Natang, EP University-hTech)-Akaah Book aoisas Try to mormalize this tall Sot Firsts, Al Al Al AL aL = ‘This table has ot of redundacies. It contains MVD» also, ‘And thin can be dine by deeosnponing #t Naw, the MVDs are W) Bngns-> Pro i) Ena + sill 0, we decompne 00% TERPROJECT (Brno, Pao) skill (Ene, shill) Qs. cb) DML. ‘Ans: DMIL: [tis used to manipalate data in the database, Some commands are: INSERT, DELETE, UPDATE and SELECT Consider the database to add data to the fields interactively we write an SQL as follows: we ned to remove them INSERT INTO CUSTOMER VALUES (& CUST_NO, '& LNAME, &FNAMEY, ‘The names need not match the column names but the type and order is important. Q.(e) Explain derived attributes? ‘Ans. Itis defined as an attribute that representa value that is derivable from the ‘valocufelated attribute or st of attributes, ot essentially inthe same entity So, the ‘Values held by some attributes are deriveds from two or more attribute values, For ‘Sample: the agate can be derived rom th dato rth atte and er QB Wd) Triggers. ‘Ans: Triggers: A trigger consists of PLSQL code which defines vome actin that the databace should take when some database relaued event occurs Triggers are executed ‘when data manspulation command (DML) ia performed aa a table far which the tigger has been written, ‘Triggers are exccuted automatically and are transparent to the aver, Also note that inorder to create a wriggt the uner must have the CR pvioge, Tie a ilabusxlive privilege is the part of the RESOURCE role sy’ wie ae D as ila its anageencet System pease Soom, Doe so one eed a abe oe data Se eae voor ins Se tnt aa as ct ose ag seer cero Fer Bemmp: Tet fn bck we the same way a8 hat a Sle we datadese evmem Ancchet exampie ovuid be a brary catalogue “—— Teng ote Wet Ordered nteng 9 Had irons te) Ordered indcring tm beeoas xd oderng ote rales of re oo Dashed ne en the wale =a ah Rebeinaing aarti andes ag FIRST TERM EXAMINATION [FEB.-2016] FOURTH SEMESTER [B.TECH] DATABASE MANAGEMENT SYSTEM (ETCS-208] Lat «30 Vime 1.90 Tre empty ts mare questions fry the remaining Nowe @ No.1 ieconpun an oe inescaate beeen Procedural abd Non provedural Query Languees z am : Procedurl quer ene SE wa What orev fo databane and bow to Eeample Nelational Algebra _Wae nt Ore ae o hents attributes not only of ts direst QL.) Define Lattice in ER-Diagram. ‘Ami. + In litice or hierarchy, a subclass in eaperclaagibut also of all 1 predecessor # TA tubclass with more than one Fe enc epecalisation hierarchies or latices, or generalization, se specialization, start with an entity type and then define rubclan of the entity {je ty suowessive epecalzation top down coneptual refinement process) Netoneraleatin, start with many entity types and generalise Unowe that have coumon pripertion (bottom up conceptual synthesis PraesA) Tin practice, the combination of two processes is employed Example of lattice: Gols Q.Li1c1 Define the concept of Aggregation with an example, ‘Ans, Aggregation Aggregation isthe process of thereby abstracting a higher-level object sametames we a ao ee a ee : ETEUSK live 22016 ‘Fount Sewester, Databose Management System LP. University-1BToch)-AB Publisher 218-3 un) Amember of weak entity set in called as a subordinate entity. ane neak cai set represented by double outlined box and the correspendiog jdentitying relation by a doubly outlined diamond “@.lue), Define view with the help of example. o oe To in nothing more than a QL statement thats stored inthe databone vi oot aw is achually a composition of « table inthe form of « predefined SQL query. saan contain all rows of « table or select rows from «table, A view can be eee cir any ublas which depends on the written SQL. query to reale @ ‘Views, which are kid of virtual tables, allow users 1 do the following: ' sere Mture dau in #way that users or lasses of users find natural or itsitiv 1 FEUerSes tothe data euch that « user can see and (sometimes) modily exacily what they need and no more San pains data from various tables which ean be used to generate report, Example: ‘Consider the CUSTOMERS table having the following records: a < TIDINAME | AGE | ADDRESS | SALARY | + 1 (Ramesh | 821 Ahmedabad | 2060.00 1 to\ 2 imhilan 1 251Dethi 1 150000 1 18 (Kaushik 1 231 Kota 1 2000.00 | ‘ow, flowing isthe example to crate a view from CUSTOMERS table 2 SQL > CREATE VIEW CUSTOMERS, VIEW AS + SELECT name, age + FROM CUSTOMERS; : + _ Now, you can query CUSTOMERS. VIEW is table. Following isthe example: ‘SQL> SELECT * FROM CUSTOMERS. VIEW; “This would produce the flowing erut: Voame tage + (Ramesh 1 921 * 1 Khilan | 251 + i #1 Kaushik | 23-4 @.2.(a) Given the relations Loan [Kean No | Branch Name | Amount 170 101 30,000 hago SB 40,000 lu2e0 PNB 25,000 en earth Seater, Database Management Syetem "a Give tbe reatonabianed wy Natural Jl, Left outer Joln ang extern squroun and thetajoin- ‘has Naural join: {LP University-(B Tech)-AB Publisher 2016-5 @.3.(a) Explain the Three Level Architecture of DEMS. o Poe tier architecture: Most widely used architecture is 3 tier architecture 3- ier amhSchte ueparutes i ter from each other on baais uf users Tt deneribed aa follows T hatabase (Data) Tier: At this ter, only database resides, Database along with sts query procering languages na in layers of 3-tierarchitectre, Wale contatae elation and their constraints v Application (Middle) Tier: At this tier the jeaton server and program, which access'databane, ‘works as abstracted [_Preseriston Fuaides. Fora user this application tier Siew of database. Users are unaware Untabare beyond application. For database-tier, application caine cxer of it Database ter ig pot aware of any other er tread epplicalvon tier, This Ger works as mediator [Aopcaton Ter between the ee { "T User (Presentation) Tier: An end user sits on this tier Proms were aspect this tir is everything: He/she doesa't know about any existence or form of database beyond this ae [hyer At this lnvermaliple views of database can be provided = by the application All views are generated by applications, ‘which resides in application Her ‘Q.3. tb) What isa key? Explain Super Key, Primary key and Foreign key. ‘s) ‘Ans: Key are very important part of Relational database. They are wed textabla and slcatfy relation between tables. They also ensure that each record within «table Eoibe uniquely identified by combination of one or more fields within a tale, ‘Super Key: (1) A super Key is defined as an attribute or a set attributes that comuely identifies a tuple within a relation Tit) Anuyer hey has the uniqueneas property bu not necessarily the inrreducibly Primary Key: (i) ie defined aa the candidate alec to identity tuple uniquely ethin the relation aan Ny eee (G) The primary hey is an eirbute or set of atrbotes that unquely east © sri tana a = “sit The primary key cant contain any NULL valve because we cameo unigusly enity maligle NULL ieee Forcign Key: It anys thatthe colum in the child table that references « pranary sey ct the paren table i caled as & Foreigh hey They are towd to Kak together two ‘or ier ates hoe mene orf enn eh tes Zor Example: Consider the falowing parent master table STD-ADD {showing strbutes, 5 came 'STD-ADD (Rall‘No, Name, Place, Pi) en “Sylfabusx live agement Systera pourth Sees, Detabase Ma soto, Sate Marts, Date) STo ars a. SGTU-ADD tbl is the pray bey where a hy a aa eal eed th primary be Scan ay that 1@-¢ Explain the folowing. QA (a) Triggers Se acs a ceneper a biock thal executes implicly whenever a particular even pac N oape canbe era aban veer oan application trigger pee pbs when a INSERT, UPDATE or DELETE statement ap oe fe cand ale mm matter which user connected Or which application = ‘Creating Statment Triggers: The trigger action defines what necd to be day shen te igpering event issued Syntax of Creating Staatement Triggers: (CREATE (OR REPLACE) TRIGGER trigrername Timing Event 1|OR Eveat 2 or Event 3} 0 table-name ems ry, ‘CREATE OR REPLACE TRIGGER secure-emp BEFORE INSERT on emp BEGIN IF (TO-CHAR (eysdate. Dy) IN CSAT,, SNUOOR (7O-CHAR yea, HEU) NOT BETWEEN (OSAND 18) dar EN RAISE - APPLICATION ERROR (20600, You may olyinsert into ENP ENDIF. ED, QA. (b) Date Definition Language ‘Commonly used DDL in SQL querying are: cae ae aa Pe set mats ro erm hn ee aay tn Seas tease es ee can ‘existing database table. This command pati additional ing columns and even > Seater ‘styect name parameters, ALTER TABLE Employee ADD DOB Dae = ‘and has a predefined syntax. The LP. University-(B Tech)-AB Publisher 2016-7 «DROP: A drop cominand deletes «table, index or view. Drop statement syntax is DROP olyect (spe abjoct name, DROP TABLE Employee “TRUNCATE ~ remove all records fram a table, including all spaces allocated for the records are removed ‘+ COMMENT ~ add comments tothe data ditionary, “+ RENAME - rename an object Q.A.c) {i) Set of Relations are USER_SCHEME (Card No,B_Name, H_addr) SUPPLIER_SCHEME (Acc_No,,S_Name, price, DOS) BORROWER (Acc_No.,Card_No, DOD Write the SQL Query for Ui Find out the name and address of borrowers who have lasued a look on UFeb2016, @ ‘Ans. SELECT B_Name, B adder FROM, BORROWER ‘Where BORROWER, Card_No = USER SCHEME. Card_No And DOI = 2/Feb2016. QA(c) i) Find the name of the suppliers with maximum price. ‘Ans, Select § Name from SUPPLIER SCHEME WHERE PRICE IN (SELECT MAX (price) FROM SUPPLIER SCHEME) a syllabusx.live LP Univeraity 400 Teeh-AB! Plisher mie @ eX. ON [APRIL-29 aun TERM EXAMINATION [APRIL-20) SRCOND TUT SEMESTER (D-TECH) pATARASE MANAGEMENT SYSTEM cepdates 4 datahnee item faite (or 900 ‘nse known ae send in rome of racing plain made By inte Data Tho dt see i es ole MM) rome te from the res _« Connection It Ts erat hmm sat cas “a i woranising the, . wai ng ee i Se Sree cine etn ss pp a fate uabalar Bares by removing duplicated data frum the relatran tables ae : yea a that hae been modified bs cw en ntti tp Te “+ Miating vedo omtens) data Franuiing data deyendossne wake see |e data i logically ‘Problem without Novwallvatton:losertion Uptation ant deletion Anam Inaghty ea ew, amatet ex re ery tequent if Ratshacse yt Normalised To tverstatn those ancivailon ey) 180 tempt whee from the UT ake at exam wf Stet table wie plnctig the andor A confirms the ore Pe ye I Now we fe kore as Diy Read [xa [amen] seme] sien ate we wwe beat jgrator Hy wanna, hoatine _ — eam : required Now, dh ime reasun chent ashe A to cancel ender, | tere | te Wp ete No a ree hag an aoe Ti wate Physio y read because B saw Ure ‘ancomaitled update of & we L = - ene ran ee ackdrees of @ atudent who acurs (wice oF em adn sil hate tuple %-ASArne clon ial the rw aa 0: Decne anvannnstint ORAS 2 a “nae Anomaly) Supine ew anne havea et sens endcatrsals eaten bt fete en oped rey cage sea Siisinaat NULL thorn aaron Analy 4 hav ny sland omparaity he en nama i a “ thal row, entire student record wall be delete! along Normalisation Rule: Normaleavon oom 1 Prat Namal Form PELE 3 Third Newal Pm — aoe Tsun tei it a Ween nee eeu at a y wo-pase locking provide? What i «dh what benefit dows stete disadvantages rewull ‘ai naming a Pty Locking protocol fal shing apart ea, ret aaa eheratan inthe tauwerten thea a ecsactian Slons gd OK alrwaiy in DNF {4 Ne na pioeatribt re ramsey dependent on the bey © Sipps a FDA s NP allows __ fully tunetanally dependent 4. TENE ioaists that A.» B depeadengy diduthey © remain in a rola ook “UPL has two phases i | — Sat wet cena hey. 8 a Felation, Amat be gt ve Tie (0) Shrinking Phase: A phase dung syllabusx.live w-2016 earth Semester, Database Management System Roles for 2PL: 1 wo transactions cannot 2 No unlock operation cna have confictng locks. a gaa lock operation in the same transa 4 No duce are affected unl all locks are obtained, loons Pree Prose x 3 Fig. PL Scheme. ols As per 2P pots the transaction can snlcked any oft existing Icke tee acquire a new lock after it has Protocol: There are two problems associated with tendency) Limitations 2PL protocols. are 1. Deadlocks labcke Lo I Read Wate Z), Read @) LP University-4RTech)-AB Publisher poet “entries in constructed, where the i ealry points tothe i database page on dik. The are tug in ain memory Mf ev wot tag Large, and ull rferencen-reade or (rriter_to database pages 0” rheactson imgina warcuting, Tiotcarrent dimectary-—sthove entries point to toe ee ipued into a ahudow directory. The shadow directory ie then saved on dik ere th curvent directory & used bythe transaction, Jnndow directory ie never modified When 8 database page created, During transaction execution, tl vente tent operation i performed, anew copy of tbe modi claewhere—on some previous to paint tthe new disk bes to point to the old unmod erwione are kept. The old vers ersion by "To recover from @ dor chaee pages and to discard the current direcury The sate of the database before transaction execution ctor trae crinatating the ehadow directory. Tho dutabuse thus i returned vo ite ere he transaction that ras exceuting when thie erash occurred. and aay aaa er raged are discarded. Committing a transaction corresponds to discarding the odie Peete tirectory Since recovery involves neither undoing nor redoing data Pre i niqas ean be eategorized as « NO-UNDO'NO-REDO technique for covery 'Q2.Arretation NADDR is defined as follows: NADIE « (namo, street, city, tate, postal code) where name is unique, and for any given portal code, there lajust one city and state. (a) Given a set of FDs for this relation. as) Q.2. (6) What are the candidate keys? Q.2.(c) Is NADDR in NF? 2NF? Explain why? Q.2.d) IfNADDR is not in BNF, normalize it into INF rolationa, (2.5) Ans. (a) (@) The candidate key is Name e) Itis in 2NF as there is dependency between money attributes me pontal nde determines eity and state. (@) NADDR = (name, street, city, state, portal_code) will be decompowed inte NADDRI = (name, street, postal code) Postal = (postal_code, city tate) [Now after decomposition NADDRI and postal are in 3a Q.3.(a) Explain Timestamp based and validation based protocols ‘Ans. Timpestamp: Thi protocal works on principle that "we must havea pos owes about the order in which the trariactions willbe accessed” Tn graph baaed Same te oe TaDUSK IVE o ourth Semester, Database Management Stem sosite a unique xed Un How to doit? oder the Bae a Taeaanres TS qu! ie alone J Menbtomtctty:t means that timestamp values alvays increase, ml seminar acs ay caiane a 2S oe ae ete aly Speraieseaeies re e ou ~ log record Cy cupdate> log red (Guy cemmaat> lg record (hed Abert log reco ii) Start» log record: It contains information stout the start of each trasaertenn Ithasa tansacuon identifier, which te always unigie 109 armani ‘ lg Record. It deseri FX, VV Where 7, Transaction Wetifier X,-Data item V,- Old data-item value Uti) Log Record: When a transaction 7 completed. ncT, comma lg recur i stored the lag fie Mic) eAbord> log Record: When « tranaactive T, w aborted dat any roses, 2 = <1, Abort> log record is stored i the eg Sle Whenever c transaction parfrma a write operations i weeeenasy record for that write be created befare the Vital vole during recovery process of the a a besa vingle database write. Ia eystan

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy