When to use a View instead of a Table?

前端 未结 8 1273
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 07:02

When should a View actually be used over an actual Table? What gains should I expect this to produce?

Overall, what are the advantages of using a view over a table?

8条回答
  •  孤街浪徒
    2020-12-04 07:25

    Views are handy when you need to select from several tables, or just to get a subset of a table.

    You should design your tables in such a way that your database is well normalized (minimum duplication). This can make querying somewhat difficult.

    Views are a bit of separation, allowing you to view the data in the tables differently than they are stored.

提交回复
热议问题