Use XPath to express the following queries to the document in Figure 15.19:

a. Find all Student elements whose Ids end with 987 and who took MAT123.
b. Find all Student elements whose ?rst names are Joe and who took fewer than three courses.
b. Find all Student elements whose ?rst names are Joe and who took fewer than three courses.

a.


//Student[../CrsTaken/@CrsCode="MAT123"
and ends-with(@StudId,"987")]


b.

//Student[starts-with(@Name,"Joe") and count(../CrsTaken) < 3]


c.

//CrsTaken[@Semester="S1996" and starts-with(../Student/@Name,"P")]

Computer Science & Information Technology

You might also like to view...

The two primary types of fire prevention systems are heat-activated and smoke-activated

Indicate whether the statement is true or false.

Computer Science & Information Technology

Describe the purpose of using inference rules to identify functional dependencies for a given relation.

What will be an ideal response?

Computer Science & Information Technology