Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose the document below contains data for battleships management. In this document, data about ships is nested within their class element, and information about battles

Suppose the document below contains data for battleships management. In this document, data about ships is nested within their class element, and information about battles appears inside each ship element. Guadalcanal Guadalcanal Surigao Strait Surigao Strait Denmark Strait Malaya North Cape 1. XPath Query Expression. For each question below, (1) Write the query in XPath. (2) Write the expected query result For these questions, you dont need to show the execution of the XPath query with a particular XML database system. 1-1. Find the names of all ships. 1-2. Find all the Class elements for classes with a displacement larger than 35000. 1-3. Find all the Ship elements for ships that were launched before 1917. 1-4. Find the names of all ships that were in battles. 2. Querying XMLType Data with SQL Functions 2-1. Create BattleShip_XML table of XMLType type. 2-2. Populate the battleship XML document to the BattleShip_XML table using INSERT INTO VALUES (); 2-3. Implement the XPath query in Q1-1 using a SQL function EXTRACT with the BattleShip_XML table. Submit the SQL statement and query result. SELECT FROM BattleShip_XML; 2-4. Implement the XPath query in Q1-2 using a SQL function EXTRACT with the BattleShip_XML table. Submit the SQL statement and query result. SELECT FROM BattleShip_XML; 3. Querying the XML document with XQuery (FLWOR) expressions 3-1. Using createResource_battleShip.XML.sql provided, register the battleShip.xml in the XML DB repository of your Oracle account. The battleship XML document will be located in /public/battleShip.xml 3-2. Implement Q1-3 using an XQuery with FLWOR expressions on /public/battleShip.xml. You dont need to use the BattleShip_XML table for that. You may need to use this template: SELECT XMLQuery ( ' ' RETURNING CONTENTS) FROM DUAL; The result format of Q3-2 should be the same with the result format of Q1-3. Submit the SQL statement and the query result. 3-3. Implement Q1-4 using an XQuery with FLWOR expressions on /public/battleShip.xml. You dont need to use the BattleShip_XML table for that. For the result format, include tag. The expected result looks like : .

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

Write a note on Quality circles.

Answered: 1 week ago

Question

Describe how to measure the quality of work life.

Answered: 1 week ago

Question

internationalization of business?

Answered: 1 week ago