XML file代写、XQuery query代做、代写SQL设计、SQL编程调试代做数据库SQL|代做R语言编程

Homework 41.Consider the following relational data:Products:pid Name Price Description---------------------------------------------------------------------p123 gizmo 22.99 greatp231 gizmoPlus 99.99 more featuresp312 gadget 59.99 good value========================================Stores:sid Name Phones-------------------------------------------------s323 Wiz 555-1234s521 Econo-Wiz 555-6543============================Sells:sid pid Markup----------------------------------------------s323 p231 10%s323 p123 25%s323 p123 15%===========================(a) We want to export this data into an XML file. Write a DTD describing thefollowing structure for the XML file: there is one root element called products the products element contains a sequence of product sub-elements, onefor each product in the database each product element contains one name, one price, and one descriptionsub-element, and a sequence of store sub-elements, one for each store that sellsthat product each store element contains one name, one phone, and one markup subelement.(b) Assume the relational database above is accessible through an XML interfacethat exports it as: p123gizmo22.99great... ... ... ... ...Write an XQuery expression that, when given an input with this structure,constructs an XML document with the structure described in part (1a).(c) Assuming that you have XML documents with the structure given in part (1a),write an XQuery expression that returns the names and prices of all products thatare sold at least at one store with a markup of 25%.(d) Write the same query in SQL over the original relational database schema.2. Consider XML data given by the following DTD:(Elements that are not defined are PCDATA.) For each of the questions belowwrite an XPath or an XQuery query.(In case you need any XQuery built-in functions, you can reference:http://www.xqueryfunctions.com/ )(a) Return all titles in the XML document (b) Find the addresses of all theaters that have some tickets under $35 on11/9/2008 and the titles of their show on that night.(c) Retrieve all concert titles whose type is chamber orchestra where the averageticket price is at least $50.(d) Write a query that constructs a new XML document with the followingstructure:3. This homework problem uses the following XML file, DTD file and XSL file:The XML FileNote that one item is repeated, and that the use of spaces is not entirely uniform. Leslie Lamport Latex: A Document Preparation System 1986 Addison-Wesley David Marr Visual information processing 1980 290 199 218 Phil. Trans. Roy. Soc. B R. K. Clifton Breakdown of echo suppression in the precedenceeffect 1987 82 1834 1835 J. Acoust. Soc. Am. David Marr Vision 1982 NY Freeman David Marr Visual information processing 1980 290 199 218 Phil. Trans. Roy. Soc. BThe DTD CodeThe XSL Code result-ns=http://www.w3.org/TR/REC-html> Bibliography Bibliography ,,, . ,, ,, pages. -,Answer the following questions.1) Modify the XSL (and maybe the XML) file so that books are displayed in astyle like that of the following:Lamport, Leslie. Latex: A Document Preparation System (AddisonWesley1986).and journal articles are displayed in a style like that of the following:Marr, David. Visual information processing, Phil. Trans. Roy. Soc. B, 290,pp.199-218, 1980.2) Add two books and two journals to the XML file, where two of the new itemshave some information missing.3) Define a new type of bibliography item for PhD theses in XSL, add two suchitems to the XML file, and add the appropriate declarations to the DTD code.转自:http://www.3daixie.com/contents/11/3444.html

你可能感兴趣的:(XML file代写、XQuery query代做、代写SQL设计、SQL编程调试代做数据库SQL|代做R语言编程)