This set of SQL Server Multiple Choice Questions & Answers (MCQs) focuses on “Query Execution Plan”.
1. Which of the following syntax is valid?
a) SET SHOWPLAN_XML { ON | OFF }
b) SET SHOWPLAN { ON | OFF }
c) SET SHOW_XML { ON | OFF }
d) None of the mentioned
View Answer
Explanation: SET SHOWPLAN_XML causes SQL Server not to execute Transact-SQL statements.
2. Point out the correct statement.
a) SET SHOWPLAN_TEXT causes Microsoft SQL Server to execute Transact-SQL statements
b) The setting of SET SHOWPLAN_ALL is set at execute or run time and not at parse time
c) The setting of SET SHOWPLAN_XML is set at execute or run time and not at parse time
d) None of the mentioned
View Answer
Explanation: When SET SHOWPLAN_XML is ON, SQL Server returns execution plan information for each statement without executing it.
3. ___________ displays the profile information for a statement.
a) SET STATISTICS
b) SET STATS PROFILE
c) SET STATISTICS PROFILE
d) All of the mentioned
View Answer
Explanation: STATISTICS PROFILE works for ad hoc queries, views, and stored procedures.
4. To produce execution plan output by using most Showplan Transact-SQL SET options, users must have _________
a) SHOW SHOWPLAN
b) SHOW PLAN
c) SHOWPLAN
d) None of the mentioned
View Answer
Explanation: The SHOWPLAN permission on the databases that contain objects referred to in the Transact-SQL statement, such as views, stored procedures, or user-defined functions.
5. Point out the wrong statement.
a) SET SHOWPLAN_XML can be specified inside a stored procedure
b) SET SHOWPLAN_XML returns information as a set of XML documents
c) SET SHOWPLAN_XML is intended to return output as nvarchar(max) for applications such as the sqlcmd utility
d) All of the mentioned
View Answer
Explanation: It must be the only statement in a batch.
6. The document containing the XML schema for the XML output by SET STATISTICS XML is located at ______________
a) \Microsoft SQL Server\100\Tools\Binn\schemas\sqlserver\2004\07\showplan\showplanxml. xml
b) \Microsoft SQL Server\100\Tools\Binn\schemas\sqlserver\2004\07\showplan\showplanxml. xsl
c) \Microsoft SQL Server\100\Tools\Binn\schemas\sqlserver\2004\07\showplan\showplanxml. xsd
d) None of the mentioned
View Answer
Explanation: SET STATISTICS XML produces XML output in the form of schema.
7. Which of the following is valid syntax for SET STATISTICS XML?
a) SET STATISTICS XML { OFF }
b) SET STATISTICS XML { ON | OFF }
c) SET STATISTICS XML { ON }
d) All of the mentioned
View Answer
Explanation: SET STATISTICS XML causes Microsoft SQL Server to execute Transact-SQL statements and generate detailed information about how the statements were executed in the form of a well-defined XML document.
8. __________ returns detailed information about how the statements are executed.
a) SET STATISTICS XML
b) SET SHOWPLAN_TEXT
c) SET STATISTICS PROFILE
d) All of the mentioned
View Answer
Explanation: SET SHOWPLAN_TEXT causes Microsoft SQL Server not to execute Transact-SQL statements.
9. The way that a statement can be physically executed is called _____________
a) query plan
b) execution plan
c) query execution plan
d) all of the mentioned
View Answer
Explanation: An execution plan is composed of primitive operations. Examples of primitive operations are: reading a table completely, using an index, performing a nested loop or a hash join.
10. SET SHOWPLAN_TEXT is intended to return readable output for ________ utility.
a) osql
b) tsql
c) plsql
d) pgsql
View Answer
Explanation: osql is Microsoft Win32 command prompt application.
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.
- Check SQL Server Books
- Apply for Programming Internship
- Practice Programming MCQs
- Check Information Technology Books