SQL Server Questions and Answers – Working With XML Data – 2

This set of SQL Server Interview Questions and Answers for experienced people focuses on “Working With XML Data – 2”.

1. What are Catalog Views for XML?
a) Schema collections
b) View Collections
c) Unstructured data
d) None of the Mentioned
View Answer

Answer: a
Explanation: Catalog views exist to provide metadata information about XML use.

2. Which of the following following is used for retrieving XML Schema Collections?
a) XML_SCHEMA_SPACE
b) XML_SCHEMA_NAMESPACE
c) XML_SCHEMA_NAMES
d) None of the Mentioned
View Answer

Answer: b
Explanation: Built-in function XML_SCHEMA_NAMESPACE yields an xml data type instance.

3. What is index type for XML index entries?
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: a
Explanation: XML index entries appear in the catalog view, sys.indexes, with the index “type” 3.
advertisement
advertisement

4. The space use of XML indexes can be found in the table-valued function named?
a) sys.dm_db_index_physical_stats
b) sys.dm_db_index_phy_stats
c) sys.dm_db_index_plan_stats
d) sys.dm_db_index_table_stats
View Answer

Answer: a
Explanation: sys.dm_db_index_physical_stats provides information, such as the number of disk pages occupied, average row size in bytes, and number of records, for all index types.

5. Contents of sys.xml_schema_collections are _____________
a) Number of disk pages occupied
b) Indexing Capabilities
c) Predefined namespaces
d) None of the Mentioned
View Answer

Answer: c
Explanation: sys.xml_schema_collections contains the namespaces for xml, xs, xsi, fn, and xdt.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Which of the following statement would import additional schema or schema components into an existing collection object?
a) IMPORT XML SCHEMA COLLECTION
b) ALTER XML SCHEMA COLLECTION
c) UPDATE XML SCHEMA COLLECTION
d) ADD XML SCHEMA COLLECTION
View Answer

Answer: b
Explanation: ALTER XML SCHEMA COLLECTION adds new schema components to an existing XML schema collection.

7. Which operation cannot be performed on XML schema collection?
a) DROP
b) DELETE
c) CREATE
d) UPDATE
View Answer

Answer: b
Explanation: XML schema collection is a metadata entity like a table in the database.
advertisement

8. Can we use untyped XML data type in the following situations?
a) You have schema for your XML data and you want the server to validate your XML data according to the XML schema
b) You want to take advantage of storage and query optimizations based on type information
c) You want to take better advantage of type information during compilation of your queries
d) You do not have a schema for your XML data
View Answer

Answer: d
Explanation: Untyped XML type does not have schema.

9. Point out the wrong statement.
a) Typed XML type and Untyped XML both have XML schema to validate the Data
b) Typed XML type has advantage of storage and query optimizations where as Untyped XML type does not have this advantage
c) Typed XML types can be validated at both client side and Server side where as Untyped XML types does not have option to validate on server side as they do not have any schema
d) None of the mentioned
View Answer

Answer: a
Explanation: Untyped XML type is preferred in scenario when you have schema, but you do not want the server to validate the data.
advertisement

10. SQL Server 2008 has made several extensions to the XML Schema support which includes?
a) Support for lax validation
b) Added support for list and union types
c) Improved handling of xs:time
d) All of the mentioned
View Answer

Answer: d
Explanation: Upgrade steps automatically occurs when you attach your SQL Server 2005 database to SQL Server 2008 for XML extension feature support.

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server for Experienced people attending interviews, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.