Docsity

Assignment 3 for Database Programming for World Wide Web | INFS 740, Assignments of Database Programming

Toggle sidebar
bg1
INFS 740 Home Assignment 3 Fall 2007
Consider an example of the “movies” XML document. The questions in Problem 1
and Problem 2 use this example.
<movies>
<movie>
<title>Transformers</title>
<source>Netflix.com</source>
<fee>10.00</fee>
<release>2007</release>
</movie>
<movie>
<title>Transformers</title>
<source>blockbuster.com</source>
<fee>11.99</fee>
<release>2007</release>
</movie>
<movie>
<title>Happy Feet</title>
<source>blockbuster.com</source>
<fee>5.99</fee>
<release>2006</release>
</movie>
<movie>
<title>Happy Feet</title>
<source>intelliflix.com</source>
<fee>8.99</fee>
<release>2006</release>
</movie>
<movie>
<title>Broken Flowers</title>
<source>Netflix.com</source>
<fee>9.99</fee>
<release>2005</release>
</movie>
<movie>
<title>Broken Flowers</title>
1
pf3

Partial preview of the text

Download Assignment 3 for Database Programming for World Wide Web | INFS 740 and more Assignments Database Programming in PDF only on Docsity!

INFS 740 Home Assignment 3 Fall 2007 Consider an example of the “movies” XML document. The questions in Problem 1 and Problem 2 use this example. Transformers Netflix.com 10.00 2007 Transformers blockbuster.com 11.99 2007 Happy Feet blockbuster.com 5.99 2006 Happy Feet intelliflix.com 8.99 2006 Broken Flowers Netflix.com 9.99 2005 Broken Flowers

idvdrentals.com 9.99 2005 Problem 1 : Express the following queries in Xquery. Use the “movies” document as input.

  1. Find movie titles that are offered from all sources in the "movies" document.
  2. For every movie title, find the sources that charge more than the average fees charged by all sources that offer this movie title.
  3. Find the sources that only offer movies with fee higher than 19.99.
  4. For every release year, list all the movie titles released that year. Eliminate duplicates if necessary.
  5. Consider a series of movies with titles containing the word "flowers". We can call this series "flowers series". List sources that offer all the movie titles in the "flower series" at the total price of over 100. Eliminate duplicates if necessary. Problem 2. Consider the “movies” document. Assume that all movie elements with the same title have the same release year. Also assume that all movie elements with the same title have the same fee, regardless of the source.
  6. Construct a DTD D for the example “movies” document.
  7. Write two XML functional dependencies that reflects the two assumptions above. Let’s call the set of the two constructed dependencies E. Are these dependencies satisfied by the example "movies" document?
  8. Complete the following definition: Given a DTD D and a set of XML functional dependencies, we say that (D, E) is in the XML normal form (XNF), if the following condition is satisfied: …………..
  9. Use the definition of XNF to show that (D, E) (for the example document and the rules above) does NOT satisfy XNF.
  10. Explain how does this violation of XNF definition cause redundancy in the "movies" document?