Question: 1. Write a SELECT statement that returns an XML document that contains all of the current shipping addresses for the customers in the database. This
1. Write a SELECT statement that returns an XML document that contains all of the current shipping addresses for the customers in the database. This document should include one element for each of these columns: FirstName, LastName, Line1, Line2, City, State, and ZipCode. Then, save the XML document thats returned in a file named CustomerAddresses.xml. Finally, generate an XML schema for the file and save it in a file named CustomerAddresses.xsd. Paste screen prints of your SQL, XML and XSD files below
2. Write a script that inserts a new row into the Customers table for each customer stored in the NewCustomers.xml file thats in the Exercise Starts directory. To accomplish this, begin by storing the contents of the XML file in a variable of the XML type. Then, you can use an INSERT statement to insert the rows into the Customers table. Paste screen prints of your SQL script and its results below
3. Write a script that returns a result set that contains all of the data stored in the NewCustomers.xml file thats in the Exercise Starts directory. To accomplish this, begin by storing the contents of the XML file in a variable of the XML type. Then, you can use a SELECT statement to return the data stored in this variable as a result set. Paste screen prints of your SQL script and its results below
4. Write a script that creates a table named ProductDescriptions. This table should have three columns. The first column should be an identity column named DescriptionsID, the second column should be a foreign key column named ProductID, and the third column should be an xml column named Description. Then, insert a new row into the ProductDescriptions table that contains the data stored in the ProductDescription.xml file thats in the Exercise Starts directory. This data should be related to the product with an ID of 1. Finally, select all rows from this table.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
