consider the following XML document. Impression 2000 10 37 Expression 900 9 85 Expression 50000 10...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
<artists > <artist name=" Vinnie Van Vooy"> consider the following XML document. <period>Impression</period> <pieces >2000</pieces> <rating >10</rating> <age>37</age> </artist > <artist name="Henri Heroic"> </artists > <period>Expression</period> <pieces >900</pieces> <rating >9</rating > <age>85</age> </artist > <artist name="Picante Public"> </artist > <period>Expression</period> <pieces >50000</pieces> <rating >10</rating> <age>92</age> 2. XQuery. Write down the following English language queries in XQuery, and show the result of evaluating the XQuery query on the given XML document. (a) For each distinct period p, for which no artist in that period p has a rating lower than 10, return an element node that lists the period and, for each artist of that period, an attribute child artist that lists the name of the artist. [5 marks] (b) For each pair of artists, where each of the two artists has produced at least 1000 pieces, return an element node pair with two element children artist that contain the name of the artist as a string, respectively. For full marks, a pair cannot contain the same artist twice, and there must not be any pairs where the order of the artists is simply swapped. [5 marks] (c) For every distinct rating, return an element node rating with an attribute child called value that lists the rating and an element child average age that contains the average age of artists with that rating. [5 marks] <artists > <artist name=" Vinnie Van Vooy"> consider the following XML document. <period>Impression</period> <pieces >2000</pieces> <rating >10</rating> <age>37</age> </artist > <artist name="Henri Heroic"> </artists > <period>Expression</period> <pieces >900</pieces> <rating >9</rating > <age>85</age> </artist > <artist name="Picante Public"> </artist > <period>Expression</period> <pieces >50000</pieces> <rating >10</rating> <age>92</age> 2. XQuery. Write down the following English language queries in XQuery, and show the result of evaluating the XQuery query on the given XML document. (a) For each distinct period p, for which no artist in that period p has a rating lower than 10, return an element node that lists the period and, for each artist of that period, an attribute child artist that lists the name of the artist. [5 marks] (b) For each pair of artists, where each of the two artists has produced at least 1000 pieces, return an element node pair with two element children artist that contain the name of the artist as a string, respectively. For full marks, a pair cannot contain the same artist twice, and there must not be any pairs where the order of the artists is simply swapped. [5 marks] (c) For every distinct rating, return an element node rating with an attribute child called value that lists the rating and an element child average age that contains the average age of artists with that rating. [5 marks]
Expert Answer:
Answer rating: 100% (QA)
The question is about the XML document provided and how to write certain XQuery expressions to extra... View the full answer
Related Book For
Stats Data and Models
ISBN: 978-0321986498
4th edition
Authors: Richard D. De Veaux, Paul D. Velleman, David E. Bock
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
When would you suggest that an organization engage in workflow analysis?
-
What role do expectations play in Tesla's production and investment decisions described in the News Wire "Production and Investment Decisions"?
-
The table shows the distribution of a group of 120 college students by gender and major. If one student is randomly selected from the group what is the probability that the student is a male...
-
The curved rod has a radius r and is fixed to the wall at B. Determine the resultant internal loadings acting on the cross section at point A which is located at an angle from the horizontal. B P
-
You decided to run an experiment - improve current CTA on the in-app pricing page (1 experimental variation and one control group). Each month the pricing page is seen by 16,000 users. 800 of those...
-
1). Do you think that other LDCs could pursue export-led growth strategies as effectively as the East Asian NIEs? 2). What political factors do you believe explain different success rates in the use...
-
Find the risk-neutral probabilities and zero cost date 0 forward prices (for settlement at date 1) for the stock in exercise 7.2. As in that exercise, assume a risk-free rate of 15% per period. 7.2....
-
Identify and briefly explain TWO circumstances in which expansionary monetary policy could not be effectively used to restore full-employment.
-
(iv) Draw the refracted ray in each diagram. Keep in mind light travels least quickly in glass, more quickly in water, and most quickly in air. Label all the lines, fast medium, slow medium,...
-
If two events A and B are such that Pr(A) = 0.5, Pr(B) = 0.3, and Pr(A and B) = 0.1 I Find: a) Pr(A/B) b) Pr(BIA) c) Pr(A| A or B) d) Pr(A| A and B) e) Pr(A and B | A or B) 2.149 A large group of...
-
Under Armour reported the following in its 2018 Form 10-K. Under Armour's income statement reported 2018 cost of goods sold of $2,852,714 thousand. Its balance sheet reported inventories of $917,546...
-
1. Let G be a graph and let u and v be two distinct vertices of G. Assume that G has two different walks between u and v. Choose the correct answer between the following (10 marks) two. (a) G has a...
-
Required: Use the Black-Scholes formula to find the value of a call option based on the following inputs. Refer Cumulative normal distribution Table. (Do not round intermediate calculations. Round...
-
Brandy is considering purchasing an 8-year bond that is selling for $700. What is the current yield for this bond if it has a 6% coupon, paid semi-annually? A. 11.92%. B. 9.32%. C. 8.57%. D. 10.17%.
-
CdF2 (s) Cd+ (aq) + 2 F- (aq) 1. A saturated solution of CdF2 is prepared. The equilibrium in the solution is represented above. In the solution [Cd+] eq = 0.0585 M and [F-] eq = 0.117 M. a....
-
The earth's climate is getting warmer. The most common theory attributes the increase to an increase in atmospheric levels of carbon dioxide (CO2), a greenhouse gas. Here is a scatterplot showing the...
-
In the regression output for the movies of Exercise 3 In Exercise 3 a) What is the null hypothesis tested for the coefficient of Stars in this table? b) What is the f-statistic corresponding to this...
-
In each of the following situations, is the alternative hypothesis one-sided or two-sided? What are the hypotheses? a) A business student conducts a taste test to see whether students prefer Diet...
-
What is the difference between real objects and virtual objects? Give an example for each.
-
Give a superclass for the following three classes: car, airplane, tank.
-
How do business classes differ from utility classes? Provide one example for each.
Study smarter with the SolutionInn App