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
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
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
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
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.
5. Every database you create has which collection by default?
a) sys
b) sym
c) syx
d) none of the Mentioned
View Answer
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
Explanation: The W3C specification allows type errors to be raised statically or dynamically, and defines static, dynamic, and type errors.
7. Functions on numerical values in Xquery are ___________
a) ceiling
b) concat
c) contains
d) number
View Answer
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
Explanation: Some of the XQuery operators, such as arithmetic and comparison operators, depend on atomization.
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
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
Explanation: exist() method is used to determine whether a query returns a nonempty result or not.
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]- Check Information Technology Books
- Practice Programming MCQs
- Apply for Programming Internship
- Check SQL Server Books