Docsity

Practice Final Exam Problems - Database Systems | CSCI 585, Exams of Deductive Database Systems

Toggle sidebar
bg1
1
XML Problem
Consider the following specification for the ā€˜Publication’ entity and its
corresponding ER model, which is designed to represent every aspect of this
specification as much as possible.
Specification of the ā€˜Publication’ Entity:
ā€œA publication must have a title, one or more authors, a published year, and a
publication type (PType). The publication type should be one of the ā€œworkshopā€,
ā€œconferenceā€, or ā€œjournalā€, with ā€œconferenceā€ as the default value. Only the
publications published between 2000 and 2005 (including 2000 and 2005) are
considered, and the format of the year value is ā€˜YYYY’ (e.g., 2002).
ER Schema:
Publication
Title PType
Year
Author
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Practice Final Exam Problems - Database Systems | CSCI 585 and more Exams Deductive Database Systems in PDF only on Docsity!

XML Problem

Consider the following specification for the ā€˜Publication’ entity and its corresponding ER model, which is designed to represent every aspect of this specification as much as possible.

Specification of the ā€˜Publication’ Entity:

ā€œA publication must have a title, one or more authors, a published year, and a publication type (PType). The publication type should be one of the ā€œworkshopā€, ā€œconferenceā€, or ā€œjournalā€, with ā€œconferenceā€ as the default value. Only the publications published between 2000 and 2005 (including 2000 and 2005) are considered, and the format of the year value is ā€˜YYYY’ (e.g., 2002).

ER Schema:

Publication

Title (^) PType

Year

Author

a) Fill out the missing parts of following XML Schema inline element/attribute declarations to represent the given ER model, including the additional constraints described in the specification as much as possible. Note that both ā€˜PType’ and ā€˜Year’ are treated as the attributes of the ā€˜Publication’ element (4pts).

<xsd: __ name=ā€publicationā€> <xsd:complexType> <xsd: ____________> <xsd:element name="title" ___________________________________> <xsd:element name="authors" _________________________________> </xsd: ___________> <xsd:attribute name=ā€ptypeā€ _____________________________> <xsd:____________> <xsd:_____________ base=ā€xsd:stringā€> <xsd:____________ value=ā€workshopā€ _______________> <xsd:____________ value=ā€conferenceā€ _____________> <xsd:____________ value=ā€journalā€ ________________> </xsd:_____________> </xsd____________> </xsd:_____________> <xsd:attribute name=ā€yearā€ _________________________________> <xsd:_________________> <xsd:restriction base=ā€____________ā€> <xsd:______________ value=________________> <xsd:______________ value=________________> </xsd:restriction> </xsd:________________> </xsd:attribute> </xsd:complexType> </xsd:____________>

XML Problem

Consider the following DTD declarations and write the corresponding Xqueries for the queries that follow.

ACTORS.DTD:

MOVIES.DTD:

a) Display the name of all actors who have worked with both directors ā€œRon Howardā€ and ā€œSteven Spielbergā€. The output should be in the following format (6pts).

Tome Hanks The DaVinci Code Saving Private Ryan …

b) Find all directors who have had at least two movies starring ā€œAngelina Jolieā€. Display them in the descending order of movie counts. The output should be in the following format (6pts).

Doug Liman 3 … …

OLAP Problem

Consider the following one dimension cube:

A[1:16]= 8 4 4 8 4 2 6 4 7 3 5 7 9 5 4 8

a) Draw the corresponding SRPS cube where k1=2. (2 points)

b) Draw the corresponding SRPS cube where k=4. (2 points)

c) Draw the corresponding SRPS cube where k=8. (2 points)

d) Draw the corresponding SRPS cube where k=16. (2 points)

e) Answer the query Sum (A[i]) where (3<=i<=12), using SRPS cubes in each of the above four cases (a,b,c,d). (Specifically show the SRPS cells you are using) (8 points)

f) Considering the update A[3]=6 , rewrite all the updated cells for each of the four cases (a,b,c,d). (4 points)

g) What is the best value of k for this problem based on the query and update costs. ( points)

h) Generalize the intuition you gained (if any) to discuss what is the best value of k for SRPS in general case. (3 points)

(^1) The length of a box

DDBMS Problem

Consider the following three relations with their keys underlined:

ARTIST (ANo, AName, ArtGenre) GALLERY (GNo, GName, Loc) SHOW (ANo, GNo, StartDate, Duration)

Furthermore, assume the following two queries:

  • Query 1 (q1):

select ARTIST.ANo, AName, SHOW.GNo, StartDate from ARTIST, SHOW where ARTIST.ANo = SHOW.ANo and Duration = 5

Suppose q1 is executed by an application that is located at sites S1 and S2, with frequencies 1 and 2, respectively.

  • Query 2 (q2):

select ANo, Duration from SHOW

Suppose q2 is executed by an application that is located at sites S2 and S3, with frequencies 2 and 1, respectively.

a) Construct the usage matrix UA for the attributes of the relation SHOW. (4 points)

(Reminder: element eij of the UA matrix is use(qi, Aj), the usage value for the attribute Aj by the query qi).

DDBMS Problem

Consider the relation Office (ID, City, State, Sales), where {ID} and {City, State} are two candidate keys.

a) List all valid vertical fragmentations of the relation ā€œOfficeā€ into exactly two fragments (4pts).

b) Assume that 50% of the queries access the attributes City and Sales, and the other 50% of the queries access ID, City, and State.

Which of the valid vertical fragmentations is (are) optimal in terms of the number of accesses? Justify your answer (8pts).