Create a document that lists every course and the professors who taught it. The course information must include the course name, and the professor information should include the professor’s name.

Use the document structure described in Exercise 15.23 to formulate the following queries in XQuery:




{
FOR $c IN doc("http://xyz.edu/courses.xml")//tuple
LET $tch := doc("http://xyz.edu/teaching.xml")
//tuple[CrsCode/@value=$c/CrsCode/@value]
LET $profs := {
FOR $t IN $tch,
$p IN doc("http://xyz.edu/professor.xml")
//tuple[Id/@value=$t/ProfId/@value]
}
RETURN

$c/CrsName
{
FOR $p IN distinct-values($profs)
RETURN $p/Name
}

}

Computer Science & Information Technology

You might also like to view...

When one value is given for padding, the value is applied to ____.

A. all four sides of the box B. the right and left sides of the box only C. the top and bottom sides of the box D. none of the above; it is not possible to only give one value for padding

Computer Science & Information Technology

A company is in the process of upgrading their network infrastructure to support new VoIP telephony equipment. Which of the following is a primary feature to consider when selecting a new switch to support the phones?

A. Port mirroring B. PoE C. VPN capability D. Modular chassis

Computer Science & Information Technology

In what clause of a SELECT statement is the JOIN specified?

a. SELECT b. FROM c. WHERE d. HAVING

Computer Science & Information Technology

Which is not a StringBuilder method?

a) Insert b) Add c) Replace d) ReplaceAll e) b and d

Computer Science & Information Technology