XQuery Notes
This post continues my notes from Introduction to Databases, a MOOC taught by Stanford’s Jennifer Widom. The topic of this post is XQuery.
XQuery Defition
XQuery is a query and functional programming language that is designed to query collections of XML data.
XQuery Syntax: FLWOR
1 2 3 4 5 |
|
A couple examples
An example with last posts countries.xml file:
1 2 3 4 |
|
Grab countries with a city larger than 10,000,000:
1 2 3 4 |
|
All of the expr
in the syntax can be XPath expressions. The FLWOR syntax should be simple to pick up for anyone familiar with scripting languages or SQL.