Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

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.

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.

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

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

Students also viewed these Databases questions