Sale!

CSE 4/560 Project 3: XML and XQuery solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (9 votes)

1. Problem Statements
You are given the following DTD data format A that describes the information about authors and books.
Assuming you have an XML document called books.xml that is valid against the given DTD, write the following
queries in your solution files, use XQuery comments to indicate your answers to the questions, e.g., (: answer
for 1.1 :). Use eXistDB or BaseX to test and verify your answers, you must use /db/books.xml as the path of the
file books.xml. The file books.xml will be posted separately.
DTD data format A:










]>
1.1(2 pts) Find the names of all Jeff’s co-authors and list them together with the titles of books that were coauthored.
Sample output format:

Big data analytics
Jeff
the other author

……
1.2(2pts) Return all the author pairs who have co-authored two or more books together, list their co-authored
books’ information.
Sample output format:


author1
author2

the book title
the book category
the book rating the book price



author1
author2

the book title
the book category
the book rating the book price


……

……
1.3(2pts) Find the average book price of each category and global. If a category has higher than global average
book price, list one most expensive book and its authors, for each of those categories.
Sample output format:



DB
Database systems 1000 author1
author2
……


……

1.4(4pts) Return all the book price and rating with book name and sort the price and rating from high to low
separately.
Sample output format 1.4a:
Applied Mathematics 100 Introduction to R programming<title/> <price>200</price> <title>Introduction to Python<title/> <price>300</price> <title>Big data analytics<title/> <price>400</price> …<br /> Sample output format 1.4b:<br /> <title>Applied Functional Analysis
2
Applied Mathematics
2.1
AWS: Security Best Practices on AWS
2.7
Introduction to R programming
3.2
Big data analytics
3.5

1.5(4pts) The text book requirement in this class is based on ‘category’: one ‘DB’, one ‘PL’, one ‘Science’, one
‘Others’. Return your plan for the book purchasing. The plan should follow some second rules (cheapest (1),
best rating (1), assume you have $1800 how to get the best rating books (2))
Sample output format 1.5a:
Big data analytics 400 DB
Applied Functional Analysis 400 Others
Introduction to R programming 200 PL
Applied Mathematics 100 Science
Sample output format 1.5b:
Database systems
5
DB
Pattern Recognition
5
Others
Introduction to Python
4.7
PL
Statistical Inference
5
Science
1.6(6 pts) Define a DTD for an equivalent DTD data format B which stores the same information as A, but in
which the authors are listed under their books. Write an XQuery query whose input is an XML document valid
with respect to the DTD A and whose output is another XML document valid with respect to B.
2. Submission
Failure to comply with the submission specifications will incur penalties for EACH violation. The project is an
INDIVIDUAL project: copying, collaboration or cooperation will be considered violations of academic integrity.
 What to submit: A zip file has to be submitted through the ‘submit_cse460’ (if you are CSE460 student)
or ‘submit_cse560’ (if you are CSE560 student) submit script by 05/03 23:59 EST. Only zip
extension will be accepted, please don’t use any other compression methods such as tar or 7zip. You
can submit multiple times, note that only the last submission will be kept on the server.
 Zip file naming: Use ubit_proj3 (NO SPACE!) for the filename, for example: jsmith_proj3.zip, where jsmith is the
ubit of submitter. The project is an INDIVIDUAL project, so everyone needs to submit ONE zip file.
 Sub-structure of zip file: On unzipping the zip file, there should be a folder named ubit_proj3, under the
folder ubit_proj3, there should be XQuery files, each should be your answers to one problem.
Reference:
https://www.w3schools.com/xml/xquery_intro.asp
http://www.datypic.com/books/xquery/examples.html