SQL Server Questions and Answers – Xquery

This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Xquery”.

1. Which of the following function returns an instance of the XML data type?
a) query()
b) value()
c) nodes()
d) none of the Mentioned
View Answer

Answer: a
Explanation: xml.query() method takes an XQuery statement and returns an instance of the XML data type.

2. SQL Server provides how many Xquery methods?
a) 3
b) 4
c) 5
d) 6
View Answer

Answer: c
Explanation: SQL Server provides five xquery methods to query xml file or xml data.

3. Point out the correct statement.
a) XQuery statements are case sensitive and xml is case sensitive
b) XQuery statements are case insensitive and xml is case insensitive
c) XQuery statements are case sensitive and xml is case insensitive
d) XQuery statements are case insensitive since xml is case sensitive
View Answer

Answer: a
Explanation: In Sql Server XQuery statements are case sensitive since xml is case sensitive. Hence while query to xml data remember this thing.

4. What is every identifier in an XQuery called?
a) Name
b) QName
c) Qidt
d) Qnam
View Answer

Answer: b
Explanation: A QName is made up of a namespace prefix and a local name. In this implementation, the variable names in XQuery are QNames and they cannot have prefixes.

advertisement
advertisement

5. Every database you create has which collection by default?
a) sys
b) sym
c) syx
d) none of the Mentioned
View Answer

Answer: a
Explanation: sys stands for system and it reserves these schemas so they can be accessed from any user-created XML schema collection.

6. Different types of errors raised during Xquery operation are ______________
a) Static
b) Dynamic
c) Type
d) All of the mentioned
View Answer

Answer: d
Explanation: The W3C specification allows type errors to be raised statically or dynamically, and defines static, dynamic, and type errors.

Note: Join free Sanfoundry classes at Telegram or Youtube

7. Functions on numerical values in Xquery are ___________
a) ceiling
b) concat
c) contains
d) number
View Answer

Answer: a
Explanation: Ceiling function returns the smallest number without a fractional part and that is not less than the value of its argument.

8. Atomization is process of extracting ________ value of an item.
a) XML value
b) Non numerical value
c) Typed
d) None of the mentioned
View Answer

Answer: c
Explanation: Some of the XQuery operators, such as arithmetic and comparison operators, depend on atomization.

advertisement

9. With XML DML, which of the operations can be performed on nodes?
a) Insert nodes
b) Change nodes
c) Delete nodes
d) None of the mentioned
View Answer

Answer: c
Explanation: To change or remove a portion of the content in an XML variable or column, the modify() method can be used.

10. Why do we use exist methods in Xquery?
a) To determine if the XML data contains a certain node
b) To examine the XML and return back a scalar value
c) To Shred the XML nodes of the XML data into relational columns
d) To search inside xml data types
View Answer

Answer: a
Explanation: exist() method is used to determine whether a query returns a nonempty result or not.

advertisement

Sanfoundry Global Education & Learning Series – SQL Server.

To practice all areas of SQL Server, 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.