Write the xml document obtained by exporting the database

Assignment Help Database Management System
Reference no: EM131511293

Question: Consider the following relational data:

pid        Name               Price              Description
323       gizmo              22.99                great
233       gizmo plus        99.99            more features
312       gadget            59.99              good value

                       Table 1: Products

sid                     Name                         Phone
s282                    Wiz                        555-1234
s521               Econo-Wiz                    555-6543

                         Table 2: Stores
   
pid               Markup                        sid
323                10%                        s521
233                25%                        s282
233                15%                        s521

                        Table 3: Sells

1. We want to export this data into an XML file. Write a DTD describing the following structure for the XML file:

• there is one root element called products

• the products element contains a sequence of product sub elements, one for each product in the database

• each product element contains one name, one price, and one description subelement, and a sequence of store
subelements, one for each store that sells that product:

• each store element contains one name, one phone, and one markup .

Write the XML document obtained by exporting the database above; you have to turn in an XML document called Products.xml. Place the DTD on the top of Products.xml. Validate the xml file with xmllint.

2. Assuming that you have XML documents with the structure given in 1, write an XQuery that returns the names and prices of all products that are sold at least at one store with a markup of 25%. Write the same query in SQL over the original relational database schema. Turn in the two queries.

3. Assume the same database is represented in an XML document whose structure follows the relational tables:

<db>
<products>
<row>
<pid> 323 </pid>
<name> gizmo </name>
<price> 22.99 </price>
<description> great </description>
<row>
<row> ... <row>
<row> ... <row>
</products>
<stores>
<row> ... <row> ...
</stores>
<sells>
<row> ... </row> ...
</sells>
</db>

Write an XQuery that, when given an input with the structure described in 1), constructs an XML document with this structure. You have to turn in a XQuery.

Reference no: EM131511293

Questions Cloud

Analyze the facilitated session in terms : Analyze the facilitated session in terms of the characteristics of adult learning and effective facilitation that you have learned about in the course.
Techniques for maintaining participant interest : Conduct research to identify techniques for maintaining participant interest in training.
Improve your effectiveness in an organization : How you can use the results of this self-assessment to improve your effectiveness and/or efficiency in an organization.
Describe the chosen field of engineering : ENGG100 Assessment - Describe the chosen field of engineering and the technological achievement of the chosen project.
Write the xml document obtained by exporting the database : We want to export this data into an XML file. Write a DTD describing the following structure for the XML file.
Write a paragraph describing long term memory : For each of the following, write a paragraph describing each of the types of memory and providing an original example of how you use each
Trade name drugs for the same symptoms : Provide advantages and disadvantages of OTC drugs as it relates to trade name drugs for the same symptoms.
What is the distance between the two cities : What is the distance between the two cities if his total traveling time was 32 hr? Determine whether each statement is true or false. If false, tell why.
Create an annotated bibliography for topic-stages of sleep : Create an annotated bibliography for the topic above to make a Psychology Research Report. Chosen topic "Stages Of Sleep"

Reviews

Write a Review

Database Management System Questions & Answers

  Knowledge and data warehousing

Design a dimensional model for analysing Purchases for Adventure Works Cycles and implement it as cubes using SQL Server Analysis Services. The AdventureWorks OLTP sample database is the data source for you BI analysis.

  Design a database schema

Design a Database schema

  Entity-relationship diagram

Create an entity-relationship diagram and design accompanying table layout using sound relational modeling practices and concepts.

  Implement a database of courses and students for a school

Implement a database of courses and students for a school.

  Prepare the e-r diagram for the movie database

Energy in the home, personal energy use and home energy efficiency and Efficient use of ‘waste' heat and renewable heat sources

  Design relation schemas for the entire database

Design relation schemas for the entire database.

  Prepare the relational schema for database

Prepare the relational schema for database

  Data modeling and normalization

Data Modeling and Normalization

  Use cases perform a requirements analysis for the case study

Use Cases Perform a requirements analysis for the Case Study

  Knowledge and data warehousing

Knowledge and Data Warehousing

  Stack and queue data structure

Identify and explain the differences between a stack and a queue data structure

  Practice on topic of normalization

Practice on topic of Normalization

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd