This is for SQL: Create a new table in your database, with your initials as suff
ID: 3718366 • Letter: T
Question
This is for SQL:
Create a new table in your database, with your initials as suffix,
e.g. myxmlRR
It should have three columns:
id is an integer, not null and is the primary key.
name is a variable length string , max length of 30
document is an xml document.
1. Create this table (@10 pts)
2. Declare a variable to hold the xml document, and Set that variable with the document shown below PLUS, add in a last name element for each Person, where Jo’s last name is “Tiger” and Kim’s last name is “Wolf”.
Don’t forget the tick marks! (@20 pts)
'<?xml version="1.0" encoding="UTF-8"?>
<People>
<Person><FirstName>Jo</FirstName></Person>
<Person><FirstName>Kim</FirstName></Person>
</People>'
3. Insert into the table where id = 10, and name = “xmlstorage”, and the xml document using your xml variable (@ 10 pts)
4. Select all the elements of that row, and, Show the expanded selected result ( as in the guide). That is, this
should show the expanded xml document you previously inserted...(@10 pts)
Explanation / Answer
1. create database OPENXMLTesting
create table myxmlRR(id int IDENTITY PRIMARY KEY,name varchar2(30),document XML);
2.
<?xml version="1.0" encoding="UTF-8"?>
<People>
<Person><FirstName>Jo</FirstName><LastName>Tiger</LastName></Person>
<Person><FirstName>Kim</FirstName><LastName>Wolf</LastName></Person>
</People>
The XML type column i.e document of the table will hold this document
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.