SQL Server Questions and Answers – Views

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

1. What is a view?
a) A view is a special stored procedure executed when certain event occurs
b) A view is a virtual table which results of executing a pre-compiled query
c) A view is a database diagram
d) None of the Mentioned
View Answer

Answer: b
Explanation: VIEW is a virtual table, through which a selective portion of the data from one or more tables can be seen. A view do not contain data of their own.

2. Which of the following is not a limitation of view?
a) ORDER BY Does Not Work
b) Index Created on View Used Often
c) Cross Database Queries Not Allowed in Indexed View
d) Adding Column is Expensive by Joining Table Outside View
View Answer

Answer: b
Explanation: Views created on indexed Columns are often used because of performance optimization problems.

3. Which of the following statement is true?
a) Views could be looked as an additional layer on the table which enables us to protect intricate or sensitive data based upon our needs
b) Views are virtual tables that are compiled at run time
c) Creating views can improve query response time
d) All of the Mentioned
View Answer

Answer: d
Explanation: Views are a valuable tool for the SQL Server Developer because they hide complexity and allow for a readable style of SQL expression.
advertisement
advertisement

4. SQL Server has mainly how many types of views?
a) one
b) two
c) three
d) four
View Answer

Answer: b
Explanation: In SQL Server we have two types of views-System Defined Views and User Defined View.

5. Dynamic Management View is a type of ___________
a) System Defined Views
b) User Defined View
c) Simple View
d) Complex View
View Answer

Answer: a
Explanation: Dynamic Management Views were introduced in SQL Server 2005. These Views give the administrator information of the database about the current state of the SQL Server machine.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. Syntax for creating views is __________
a) CREATE VIEW AS SELECT
b) CREATE VIEW AS UPDATE
c) DROP VIEW AS SELECT
d) CREATE VIEW AS UPDATE
View Answer

Answer: a
Explanation: SQL CREATE VIEW Syntax:CREATE VIEW view_name AS SELECT column_name(s) FROM table_name WHERE condition.

7. You can delete a view with ___________ command.
a) DROP VIEW
b) DELETE VIEW
c) REMOVE VIEW
d) TRUNCATE VIEW
View Answer

Answer: a
Explanation: DROP VIEW removes one or more views from the current database.
advertisement

8. What is SCHEMABINDING a VIEW?
a) Schema binding binds your views to the dependent physical columns of the accessed tables specified in the contents of the view
b) These are stored only in the Master database
c) These types of view are defined by users on a specified schema
d) These are used to show database self describing information
View Answer

Answer: b
Explanation: SCHEMABINDING binds the view to the schema of the underlying table or tables. When SCHEMABINDING is specified, the base table or tables cannot be modified in a way that would affect the view definition.

9. Which of the following is not a SQL Server INFORMATION_SCHEMA view?
a) INFORMATION_SCHEMA.CONSTRAINT_TABLE_USAGE
b) INFORMATION_SCHEMA.DOMAIN_CONSTRAINTS
c) INFORMATION_SCHEMA.KEY_COLUMN_USAGE
d) sys.dm_exec_connections
View Answer

Answer: d
Explanation: The INFORMATION_SCHEMA views allow you to retrieve metadata about the objects within a database. These views can be found in the master database under Views / System Views and be called from any database in your SQL Server instance.
advertisement

10. ___________ is stored only in the Master database.
a) Database-scoped Dynamic Management View
b) Complex View
c) Catalog View
d) None of the mentioned
View Answer

Answer: d
Explanation: Server-scoped Dynamic Management View is stored only in the Master database.

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.