If views are used to show selected columns to the user, and same can be done by using
SELECT col1, col2
FROM xyz
, what is the point of using views?
If views are used to show selected columns to the user, and same can be done by using
SELECT col1, col2
FROM xyz
, what is the point of using views?
A view can be more complicated than just showing certain columns. It is a stored query. Wikipedia has much more detail.
10
queries in the different places of your code.refer to this link and u know more about views http://www.sql-server-performance.com/articles/dev/views_in_sql_server_p1.aspx
Views make SQL easier to write (and read).
You can also use views to control access permissions.
As Quassnoi said, it's useful for granting permission to certain rows in a table.
For example, let's say a lecturer at a university needs access to information on students in her classes. She shouldn't have access to the "students" table because she could look up or modify information for any student in the whole university. The database admin makes a view that only shows students from the lecturers classes and gives the lecturer the appropriate permissions for the view. Now the lecturer has access to her own students' data, but not the whole "students" table.