| ||
1. | Which is the standard established by INCITS?
|
|
2. | Which of these are tools used to generate XML documents and XML document fragments from Oracle Database tables?
|
|
3. | What does the EXTRACT('/*') method do?
|
|
4. | England and Japan are both island nations. They are also in different regions of the world. All countries are contained within regions . How many nodes will this query find? SELECT X.XML.EXISTSNODE( '/demographics/region/country[name="England" and name="Japan"]') FROM XML X WHERE X.ID=2;
|
|
5. | Assume for the following SQL statements that if data can be retrieved for a query that data does exist in the XMLType, as stored in the table called XML. Which statements will retrieve a node and its subtree?
|
|
Answers
1. | Exercise 1 solution d. SQL/XML is a standard established by INCITS (the International Committee for Information Technology Standards). This standard is established in order to attempt to standardize XML use with SQL in relational databases. |
2. | Exercise 2 solution e. All of the above. PL/SQL can be used to call functions provided in the DBMS_XMLGEN package. PL/SQL can also be used to generate XML documents using SQL, cursors , and stored procedures, both as output display and as XMLType data (see Appendix B). The SYS_XMLGEN function allows for limited XML data generated, as does the DBMS_XMLGEN package. The easiest method of generating XML documents is to use PL/SQL code because PL/SQL allows for full program control. Full program control allows for the easiest method of converting between relational table structures into XML object hierarchical structures. |
3. | Exercise 3 solution d. Retrieves all the content of an XML document from an XMLType stored in an Oracle database, in a more readable, properly organized format. Without use of the EXTRACT method, the output will be a single string, with no indenting at the start of each line for each subtree, and no line breaks. |
4. | Exercise 4 solution a. 0. The query will finding nothing because the and , not the or , operator is used. The two countries cannot be retrieved because they are in two different regions of the world, and each country is a child of one other region node. If the or operator were used instead then both countries would be retrieved, including all subtree data for each country, within each country. |
5. | Exercise 5 solution a. is correct because the EXTRACT method finds the subtree for the country China. b. is incorrect because being an UPDATE statement, it retrieves nothing, changing content only in a table. c. is incorrect because the EXISTSNODE method returns a 0, meaning nothing is found, or 1, indicating a node was found. The EXISTSNODE method does not actually return a node, but only an indication that the node does or does not exist. d. is also incorrect because the GETROOTELEMENT method returns the root element only, excluding its subtree, which happens to be the rest of the XML document. |
| ||