Programming Assignment #8
Using XQuery

Due on Tuesday December 4 before midnight.


Description

The purpose of this project is to learn XQuery.

This project must be done individually. No copying is permitted. Note: We will use a system for detecting software plagiarism, called Moss, which is an automatic system for determining the similarity of programs. That is, your program will be compared with the programs of the other students in class as well as with the programs submitted in previous years. This program will find similarities even if you rename variables, move code, change code structure, etc.

Note that, if you use a Search Engine to find similar programs on the web, we will find these programs too. So don't do it because you will get caught and you will get an F in the course (this is cheating). Don't look for code to use for your project on the web or from other students (current or past). Just do your project alone using the help given in this project description and from your instructor and GTA only.

Platform

You will do this project on your own PC/laptop. You will use Zorba, which is a free implementation of XQuery.

Put all XQueries in a file "queries.xq" and use the Zorba Command Line Utility to evaluate the XQueries.

Note: If you get the error message on Windows: "The program can not start because libiconv.dll is missing from your computer. Try reinstalling the program to fix the problem", rename the iconv.dll library in the bin folder to libiconv.dll.

Documentation

The following provide some tutorials. Use them as a reference only.

Project Requirements

Consider the XML document available at reed.xml with DTD reed.dtd used in Project #7. Express the following queries using XQuery and run them against the file reed.xml using Zorba:

  1. For each MATH course taught in room LIB 204, return an element tagged course with the title, the instructor, the start, and the end times of the course.
  2. For each different course, return an element tagged course with the course title and all the instructor names that teach this course.
  3. For each different department, display the department code and the number of courses taught by the department.
  4. For each different instructor, return an element tagged instructor that contains the name of the instructor and the number of courses taught by the instructor.
  5. For each different instructor, return an element tagged instructor that contains the name of the instructor and the titles of all courses taught by the instructor.

What to Submit

Use the form below to submit your XQuery file (or you may zip all XQuery files and submit the zipped file).

Submit Project #8:

Last modified: 11/20/2018 by Leonidas Fegaras