






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







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:____________>
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).
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).
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
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:
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.
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).
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).