Why is database view used?

后端 未结 4 2021
[愿得一人]
[愿得一人] 2021-01-04 07:25

Is using \"view\" in db design right method or we should handle it code side? What are the advantages or disadvantages?

4条回答
  •  太阳男子
    2021-01-04 08:15

    Two typical scenarios for views in our case are:

    • Some columns in a table contain confidential data that should be only seen by a few people. You can create a view that excludes those columns and use that view for most users.
    • You join two or more tables into a denormalised view that is practical for reporting purposes but would not make sense as a table for storage in the database.

    Hope this helps.

提交回复
热议问题