

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
An overview of various xquery features including element constructors, sequence operators, conditional expressions, order in xml, quantifiers, functions, filtering, data types, test or modify datatypes, explicit data types, typeswitch, and conformance features. It also covers the use of xquery with basic and relational databases.
Typology: Study notes
1 / 25
This page cannot be seen from the preview
Don't miss anything!


















INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
Laurie
Reeves
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
Return
a
list
of
students
who
have
taken
at
least
courses
$p
document(
“students.xml")//student
$b
document(
“courses.xml)//course[student
$p] WHERE
count($b)
$p
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
$h
//item
{$h/name,
($h/@type
“Student")
$h/ID
$h/description
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
LET $p := //course[1]FOR $e IN //* AFTER ($p//midterm_1)[1] BEFORE
($p//midterm_2)[2]
RETURN $e
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
Test or modify datatypes
-^
INSTANCEOF – Boolean binary operator, returnstrue if left operand is the same datatype as theright^ $x INSTANCEOF zoonames:animal{5} instance of element(*, xs:integer)
-^
CAST – changes the datatype^ (x DIV y) CAST AS integer
-^
TREAT – treats one datatype as another for agiven expression^ $mypet TREAT AS Cat
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM
INFS 740, Prof. A. Brodsky, IT&E, GMU. Based on material by Prof. X.S. Wang, UVM