110 likes | 235 Views
XML and Databases. By Jared Foster. What is XML?. Extensible Markup Language (XML) Similar to HTML XML is about 5 years old Allows information and services to be encoded with a meaningful structure that both computers and humans can understand. Example.
E N D
XML and Databases By Jared Foster
What is XML? • Extensible Markup Language (XML) • Similar to HTML • XML is about 5 years old • Allows information and services to be encoded with a meaningful structure that both computers and humans can understand.
Example <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
Features of XML Databases • The XML data model, is flexible enough to handle technical documentation, health care tracking, and customer profiles, full-text searches, and structured query languages like XQuery. • XML databases are able to handle, more efficiently, large documents, as well as large numbers of documents.
Kinds of XML Databases • Document-centric • Designed for human consumption • Articles • Manuals • Has a uniform structure • Data-centric • Designed for computer consumption • Scientific data • Inventory information • Does not have a uniform structure
Oracle • Oracle introduced XML capabilities in Oracle9i Release 2 • Allowed for the querying, retrieval, and management of XML data. • In Oracle 10g Release 2 introduced XML indexing and more efficient querying tools. • XQuery • XMLIndex
XQuery • Statement • doc("books.xml")/bookstore/book[price<30]
<?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="COOKING"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> </bookstore>
Result Result <book category="CHILDREN"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book>
References • Lee, Geoff. May 2005. Oracle Database 10g Release 2 Technical Overview. http://www.oracle.com/technology/tech/xml/xmldb/Current/twp_xmldb_10gr2_tech_overview.pdf • Bourret, Ronald. September, 2005. XML and Databases. http://www.rpbourret.com/xml/XMLAndDatabases.htm • Refsnes Data. 2005. XQuery Example. http://www.w3schools.com/xquery/xquery_example.asp