Why do you create a View in a database?

前端 未结 25 2021
一个人的身影
一个人的身影 2020-11-28 17:10

When and Why does some one decide that they need to create a View in their database? Why not just run a normal stored procedure or select?

25条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-28 17:46

    For security: Gives each user permission to access the database only through a small set of views that contain the specific data the user or group of users is authorized to see, restricting user access to other data.

    Simplicity for queries and structure: A view can draw data from several tables and present a single table, simplifying the information and turning multi-table queries into single-table queries for a view and it give users a specific view of the database structure, presenting the database as a set of virtual tables specific to particular users or groups of users.

    For create consistent database structure: Views present a consistent, unchanged image of the database structure, even if underlying source tables are changed.

提交回复
热议问题