1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xxMikexx [17]
2 years ago
11

Using the XML Document below (library with books), define the following queries in XQuery: (a) Give the titles of all Books sort

ed by Price. (b) How many books were written by Abiteboul? (c) Give for each author, the number of books he has written.
Computers and Technology
1 answer:
Softa [21]2 years ago
3 0

Answer:

Explanation:

a)use order by clause for sorting

for $x in doc("books.xml")/bib/book order by xs:float($x/price) return $x/title (default sorted in ascending order)

or

for $x in doc("books.xml")/bib/book order by xs:float($b/price) descending  return $b/title (sorted in descending order)

b)doc("books.xml")//book[author = 'Abiteboul']

c)for $x in distinct-values(doc("bib.xml")/bib/book/author)

return <res>

<name>{$x}</name>

<count>

 {count (doc("bib.xml")//book[exists(indexof(author,$x))]) }

</count>

<res>

You might be interested in
What is output? Select all that apply. c = 0 while (c &lt; 10): c = c + 5 print (c) 0 1 2 3 4 5 6 7 8 9 10
Harlamova29_29 [7]

Answer:

5 10

Explanation:

that's the answer : 5 10

4 0
3 years ago
You are given an array of integers, each with an unknown number of digits. You are also told the total number of digits of all t
Vlad [161]

Answer:

Explanation:

Since all of the items in the array would be integers sorting them would not be a problem regardless of the difference in integers. O(n) time would be impossible unless the array is already sorted, otherwise, the best runtime we can hope for would be such a method like the one below with a runtime of O(n^2)

static void sortingMethod(int arr[], int n)  

   {  

       int x, y, temp;  

       boolean swapped;  

       for (x = 0; x < n - 1; x++)  

       {  

           swapped = false;  

           for (y = 0; y < n - x - 1; y++)  

           {  

               if (arr[y] > arr[y + 1])  

               {  

                   temp = arr[y];  

                   arr[y] = arr[y + 1];  

                   arr[y + 1] = temp;  

                   swapped = true;  

               }  

           }  

           if (swapped == false)  

               break;  

       }  

   }

8 0
2 years ago
For what show did the actor, whose star is located at 6667 Hollywood Boulevard, earn an Emmy Award for Outstanding Supporting Ac
Ilya [14]

The show’s title is China Beach, which was a television series set in a hospital during the Vietnam War. It was aired from 1988 to 2001. The actress who won a Primetime Emmy Award for Outstanding Supporting Actress in a Drama Series was Marg Helgenberger. She won in 1990 for her role as a part-time prostitute who is also a volunteer, Karen Charlene "K.C." Koloski.  


4 0
2 years ago
Read 2 more answers
In programming, what is a string?
vovikov84 [41]

Answer:

B.

Explanation:

A. is not the correct answer because that is called a LAN cable (ethernet)

C. is not correct because it has nothing to do with text messages or printing

D. is called a Bus, and isn't the right answer either

3 0
3 years ago
Read 2 more answers
A teacher wants to create a list of students in her class. Using the existing Student class in this exercise. Create a static Ar
aleksandr82 [10.1K]

Answer:

Check the explanation

Explanation:

CODE:-

import java.util.ArrayList;

class Student

{

  private String name;

  private int grade;

  private static ArrayList<Student> classList = new ArrayList<Student>();

 

  public Student(String name, int grade)

  {

      this.name = name;

      this.grade = grade;

      classList.add(this);

  }

 

  public String getName()

  {

      return this.name;

  }

 

  /*Don't change the code in this method!

  This method will print out all the Student names in the classList Array

  */

  public static String printClassList()

  {

      String names = "";

      for(Student name: classList)

      {

          names+= name.getName() + "\n";

      }

      return "Student Class List:\n" + names;

  }

}

public class ClassListTester

{

  public static void main(String[] args)

  {

      //You don't need to change anything here, but feel free to add more Students!

      Student alan = new Student("Alan", 11);

      Student kevin = new Student("Kevin", 10);

      Student annie = new Student("Annie", 12);

      Student smith = new Student("Smith", 11);

      Student kane = new Student("Kane", 10);

      Student virat = new Student("Virat", 12);

      Student abd = new Student("ABD", 12);

      Student root = new Student("Root", 12);

      System.out.println(Student.printClassList());

  }

}

Kindly check the attached image below.

4 0
3 years ago
Other questions:
  • Explain what the 35ppm specification means
    13·1 answer
  • Declare a char array named line of size 50, and write a statement that reads in the next line of console input into this array.
    6·1 answer
  • The information stored in the _____ is used by the DBMS for a recovery requirement triggered by a ROLLBACK statement, a program'
    7·1 answer
  • Theodor is researching computer programming. He thinks that this career has a great employment outlook, so he'd like to learn if
    9·2 answers
  • Complete the statement using the correct term.
    6·1 answer
  • Define a function pyramid_volume with parameters base_length, base_width, and pyramid_height, that returns the volume of a pyram
    6·2 answers
  • A small network that consists of devices connected by Bluetooth, such as a smartphone and a computer, is referred to as a ______
    14·1 answer
  • What is required to publish documents on the Web
    12·1 answer
  • When a ____________ file is opened, it appears full-screen, in slideshow mode, rather than in edit mode.
    6·1 answer
  • The project objective is the detailed description of the characteristics of the project. True or False?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!