Back
ExamFull examExam paper only

31 08 18ts

Full exam for Data Bases 2 in the Computer Engineering degree programme at Politecnico di Milano. The document covers: DATA BASES 2 – AUGUST 31ST, 2018 – TIME: 2H 15M PROF. DANIELE M. BRAGA, PROF. STEFANO PARABOSCHI A. Active Databases (9 p.) PERSON (ID, BIRTHDATE, FATHERID, MOTHERID, NUMANCESTORS, NUMDESCENDANTS) The table describes the genealogy of people. FatherId and MotherId can be null

Data Bases 2Full exam

Document information

What's included in this study material

Full exam for Data Bases 2 in the Computer Engineering degree programme at Politecnico di Milano. The document covers: DATA BASES 2 – AUGUST 31ST, 2018 – TIME: 2H 15M PROF. DANIELE M. BRAGA, PROF. STEFANO PARABOSCHI A. Active Databases (9 p.) PERSON (ID, BIRTHDATE, FATHERID, MOTHERID, NUMANCESTORS, NUMDESCENDANTS) The table describes the genealogy of people. FatherId and MotherId can be null

Import quality: text was extracted directly from the original document.

Extracted content from the document

Representative passages recognised in different parts of the material. The full extracted text remains available to search, while this compact preview makes the page easier to read.

Page 1

DATA BASES 2 – AUGUST 31ST, 2018 – TIME: 2H 15M PROF. DANIELE M. BRAGA, PROF. STEFANO PARABOSCHI A. Active Databases (9 p.) PERSON (ID, BIRTHDATE, FATHERID, MOTHERID, NUMANCESTORS, NUMDESCENDANTS) The table describes the genealogy of people. FatherId and MotherId can be null when this information is not available. The BirthDate cannot be null. Write a set of triggers that react to insertions into the table and (i) reject tuples that have a birthdate smaller than that of any of the parents, and (ii) maintain the values of attributes NumAncestors and NumDescendants, which respectively represent the number of ancestors and descendants present in the database (we assume that the sets of ancestors and descendants do not include repetitions). Discuss the termination of the triggers. Also discuss how triggers could keep the structure consistent after the deletion of a tuple. B.1 Concurrency Control (4 p.) Classify this schedule w.r.t. VSR, CSR, 2PL, 2PL-strict, TS-mono, TS-multi, giving terse but precise justifications: r1(A) r2(A) w2(A) r1(B) w1(C) w2(C) r3(C) w3(A) w2(B) w3(B) B.2 Deadlocks (2 p.) Update lock (UL) was introduced so as to contrast deadlocks. Can we state that deadlocks are impossible in the presence of Update Locks? If so, concisely explain why; if not, provide a counter-example. C. XML (9 p.) <!ELEMENT Genealogy ( Person+ )> <!ELEMENT Person ( Name, Sex, BirthDate, BirthPlace, Children? )> <!ATTLIST Person id ID #REQUIRED father IDREF #IMPLIED> <!ELEMENT Name ( Given, Middle?, Last )> <!ELEMENT Children ( Person+ )> The DTD above describes the genealogy of a community. Please note the asymmetry in the schema : people are represented as sub-elements of their mothers (when the mother is known), while fathers are represented as references (when known).…

Preview

First page of the document.

First page: 31 08 18ts