Skip to main content


developerWorks  >  Information Management | XML  >

SQL and XQuery tutorial for IBM DB2, Part 7: Introduction to XML and XQuery

The basics of XML and XML query

developerWorks

Level: Introductory

Pat Moffatt (pmoffatt@ca.ibm.com), Information Management Program Manager, IBM Academic Initiative, IBM 
Bruce Creighton (bcreight@ca.ibm.com), Skills Segment Planner, IBM 
Jessica Cao , Training Tools Developer, IBM 

31 Aug 2006

Register now or sign in using your IBM ID and password.

This tutorial introduces pureXML™ and XQuery, starting from a basic overview of the characteristics and advantages of the XML data type, and then compares it with standard relational tables. Users are then asked to write XQueries to retrieve XML elements, filter data based on XML values, transform XML output, and use various clauses to select data more precisely. The tutorial ends with a section on mixing XQuery and SQL. This tutorial is Part 7 of the SQL & XQuery tutorial for IBM® DB2® series. (Note: You must have DB2 9 installed to do the hands-on exercises in this tutorial.)

Prerequisites

This tutorial was written for DB2 Express-C 9 for UNIX®, Linux® and Windows® (formerly known as Viper). You should be familiar with DB2 and databases. It is preferable that you view the other tutorials in this series before attempting this tutorial, part seven.


System requirements

To use this tutorial to the fullest, you should have IBM DB2 9 installed. Download DB2 Express-C, a no-charge version of DB2 Express Edition for the community that offers the same core data features as DB2 Express Edtion and provides a solid base to build and deploy applications. You will also need to install the Aroma database, which can be downloaded in the tutorial.



Duration

Under 2 hours


Formats

html, pdf


About this tutorial

This tutorial introduces readers to pureXML and XQuery. The only place XML is used in the Aroma database is the Comments column. This column was mentioned in Part 1 of this series and it is the focus of this tutorial, part 7.

This tutorial starts out with a basic overview of the characteristics and advantages of the XML data type, and then compares it with standards relational tables. It then asks readers to write XQueries to retrieve XML elements, filter data based on XML values, transform XML output, and use various clauses to select data more precisely. The tutorial ends with a section on mixing XQuery and SQL and combining the power of the two languages.

Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed

Discuss


My developerWorks needs you!

Connect to your technical community


More in this series:
SQL and XQuery tutorial for IBM DB2