Employing XML, XQUERY, and SQL Queries Techniques – Assignment Example

Download full paperFile format: .doc, available for editing

The paper “ Employing XML, XQUERY, and SQL Queries Techniques” is a   brilliant variant of assignment on logic & programming. Here, the SQL command is selecting data from two tables, Orders, and Order details. At the same time, it is checking in the order details table for orders whose unit prices are less than 20. The comparison in both SQL and XQuery is similar to the < sign is used in both cases. Only one field is displayed from the Order Details table, hence no need for enclosing it into brackets, in the case of XQuery. Display some details of orders whose unit price is greater than $20 but less than $50 SQL Command: SELECT Orders. Order ID, Orders. Employee ID, Orders. Customer ID, Orders. Order Date, Order Details.

Unit Price FROM Orders, Order Details WHERE Orders. Order ID = Order Details. Order ID and Order Details. Unit Price > 20 and Order Details. Unit Price < 50; XQuery: for $Orders in //Orders let $Order Details: = //Order Details [Order ID = $Orders/ID][Unit Price> 20][Unit Price< 50] return < Orders> {$Orders/(Order ID | Employee ID| Customer ID| Order Date | } {$Order Details/Unit Price} < /Orders> Report: Here, the SQL command is selecting data from two tables, Orders, and Order details.

At the same time, it is checking in the order details table for orders whose unit prices are greater than 20 but less than 50. In this case, there are two sets of comparisons to be made in the field, “ Unit Price” . SQL allows for these two conditions using the keyword “ and” . In XQuery, on the other hand, the two comparisons are done separately, and each is enclosed in its own square brackets. Once one condition has been met. The next condition is also checked, and only when it is met is when the rest of the query instructions are executed.

Only one field is displayed from the Order Details table, hence no need for enclosing it into brackets, in the case of XQuery. Display some details of orders whose unit price is greater than $50 SQL Command: SELECT Orders. Order ID, Orders. Employee ID, Orders. Customer ID, Orders. Order Date, Order Details. Unit Price FROM Orders, Order Details WHERE Orders. Order ID = Order Details. Order ID and Order Details. Unit Price > 50; XQuery: for $Orders in //Orders let $Order Details: = //Order Details [Order ID = $Orders/ID][Unit Price> 50] return < Orders> {$Orders/(Order ID | Employee ID| Customer ID| Order Date | } {$Order Details/Unit Price} < /Orders> Report: Here, the SQL command is selecting data from two tables, Orders, and Order details.

At the same time, it is checking in the order details table for orders whose unit prices are greater than 50. The comparison in both SQL and XQuery is similar to the < sign is used in both cases. Only one field is displayed from the Order Details table, hence no need for enclosing it into brackets, in the case of XQuery. Display some details of orders shipped to New York SQL Command: SELECT Orders. Order ID, Orders. Employee ID, Orders. Customer ID, Orders. Order Date, Orders. Shipped Date, Orders. Ship Name, Orders. Ship City, Order Status. Status Name FROM Orders, Order Status WHERE Order Status. Status ID = Orders. Status ID and Orders.

Ship City = “ New York” ;

Bibliography

BRUNDAGE, M. (2004). XQuery the XML query language. Boston, Addison-Wesley. http://proquest.safaribooksonline.com/0321165810.

CHAMBERLIN, D., & KATZ, H. (2003). XQuery from the experts: a guide to the W3C XML query language. Boston, Mass. [u.a.], Addison-Wesley.

FAWCETT, J., AYERS, D., & QUIN, L. R. E. (2012). Beginning XML, 5th Edition. New York, Wiley. http://www.books24x7.com/marc.asp?bookid=46607.

HOPPE, A. (2008). Materialized view matching and compensation for SQL/XML and Xquery. Thesis (M.Sc.)--York University, 2008.

HUNTER, D. (2007). Beginning XML. Indianapolis, IN, Wrox/Wiley Pub.

KLEIN, S. (2006). Professional SQL Server 2005 XML. Indianapolis, Wiley Pub.

MCGOVERN, J. (2004). XQuery kick start. Indianapolis, Ind, Sams.

MELTON, J., & BUXTON, S. (2006). Querying XML XQuery, XPath, and SQL/XML in context. San Francisco, Calif, Morgan Kaufmann. http://site.ebrary.com/id/10229489.

PAPAKONSTANTINOU, Y., & MANOLESCU, I. (2006). Querying XML with XQuery. New York; London, Springer.

RAY, E. T. (2003). Learning XML. Beijing, O'Reilly. http://proquest.safaribooksonline.com/0596004206#######.

Download full paperFile format: .doc, available for editing
Contact Us