Write a script that inserts a new row into the customers


Lab Assignment

Exercise

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 that's 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 that's 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 that's 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 that's 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.

Attachment:- Attachments.rar

Solution Preview :

Prepared by a verified Expert
Database Management System: Write a script that inserts a new row into the customers
Reference No:- TGS01412816

Now Priced at $45 (50% Discount)

Recommended (94%)

Rated (4.6/5)