In SQL Server, you can queries as views. Views are beneficial for many reasons, including security, usability, and convenience.
In SQL Server, a view is a virtual table whose contents are defined by a query. It is basically a pre-written query that is stored on the database.
A view consists of a SELECT statement, and when you run a query against the view, you see the results of it like you would when opening a table. Views are referred to as virtual tables because they can pull together data from multiple tables, as well as aggregate data, and present it as though it is a single table.
Benefits of Views
A view can be useful when there are multiple users with different levels of access, who all need to see portions of the data in the database (but not necessarily all of the data). Views can do the following:
Restrict access to specific rows in a table
Restrict access to specific columns in a table
Join columns from multiple tables and present them as though they are part of a single table
Present aggregate information (such as the results of the COUNT() function)
How to Create a View
You create a view by using the CREATE VIEW statement, followed by the SELECT statement.