Solved

Provide XQuery Expressions for the Following Queries Based on the Sample

Question 4

Essay

Provide XQuery expressions for the following queries based on the sample XML file (books.xml) below.
Provide XQuery expressions for the following queries based on the sample XML file (books.xml) below.     (a) List the title of the first book. (b) List the titles of all the books along with a count of the number of books. (c) List the title and price of each book published in the year 2003. (d) List the title and numbers of authors of each book. (e) List the titles of books whose price is less than $60. (f) List the titles of books in alphabetical order. (g) List the authors, sorted in reverse order of surname, then first name. (h) List the authors as a single string, sorted in reverse order of surname, then first name. (I) List the titles of books that have at least one author called Thomas Connolly. (j) List the titles of books that have every author called Thomas Connolly. (k) List books by author. (l) Test whether the most expensive book is also the book with the largest number of authors/editors. (m) List the books where Begg is an author but is not listed as the first author. (n) List the titles of books that are more expensive than the average book price.
(a) List the title of the first book.
(b) List the titles of all the books along with a count of the number of books.
(c) List the title and price of each book published in the year 2003.
(d) List the title and numbers of authors of each book.
(e) List the titles of books whose price is less than $60.
(f) List the titles of books in alphabetical order.
(g) List the authors, sorted in reverse order of surname, then first name.
(h) List the authors as a single string, sorted in reverse order of surname, then first name.
(I) List the titles of books that have at least one author called Thomas Connolly.
(j) List the titles of books that have every author called Thomas Connolly.
(k) List books by author.
(l) Test whether the most expensive book is also the book with the largest number of authors/editors.
(m) List the books where Begg is an author but is not listed as the first author.
(n) List the titles of books that are more expensive than the average book price.

Correct Answer:

verifed

Verified

(a) doc("books.xml")/book[1]/title
This ...

View Answer

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents