Create the list of all students (include student Id and name) who took a course from John Smyth and received an A.

Using the document structure described in Exercise 15.23, formulate the following queries in XQuery:




{
LET $pset := doc("http://xyz.edu/professor.xml")
//tuple[Name/@value="John Smyth"]
LET $tset := doc("http://xyz.edu/teaching.xml")
//tuple[ProfId/@value=$pset/Id/@value]
FOR $s IN doc("http://xyz.edu/student.xml")//tuple,
$p IN $pset,
$t IN $tset
WHERE doc("http://xyz.edu/transcript.xml")
//tuple[StudId/@value=$s/Id/@value
and CrsCode/@value=$t/CrsCode/@value
and Semester/@value=$t/Semester/@value
and Grade/@value="A"]
RETURN

$s/Id,
$s/Name

}



Note that the problem statement requires that we return only the name and the Id, so we cannot just return $s.

Computer Science & Information Technology

You might also like to view...

Discuss the four practical things that should be substantiated in the expert judgment.

What will be an ideal response?

Computer Science & Information Technology

Write a method for Turtle to draw a hexagon. Pass in the length of the sides.

What will be an ideal response?

Computer Science & Information Technology

public class scopeRule                                //Line 1{                                                     //Line 2    static double intRate = 0.055;                    //Line 3    static String name;                               //Line 4    static int t;                                     //Line 5    public static int main(String[] args)             //Line 6    {                                                 //Line 7        int first;                                    //Line 8       

double u, t;                                  //Line 9        String str;                                   //Line 10        //...                                         //Line 11    }                                                 //Line 12    public static int first(int x, int y)             //Line 13    {                                                 //Line 14        int t;                                        //Line 15        //...                                         //Line 16    }    public static double salary;                      //Line 17    public static void funcOne(int first, double x)   //Line 18    {                                                 //Line 19        char ch;                                      //Line 20        int y;                                        //Line 21            //block one                                   //Line 22        {                                             //Line 23            int u = 18;                               //Line 24            //...                                     //Line 25        } //end block one                             //Line 26    }                                                 //Line 27}                                                     //Line 28Which of the following identifiers seen in the accompanying figure is visible in main? A. t (Line 5) B. salary (Line 17) C. local variables of method funcOne D. All identifiers are visible in main.

Computer Science & Information Technology

Realistic ________ should be assigned to each step of the plan

A) backups B) stakeholders C) software D) time limits

Computer Science & Information Technology