What are views good for?

后端 未结 14 1233
你的背包
你的背包 2020-11-28 03:31

I\'m just trying to get a general idea of what views are used for in RDBMSes. That is to say, I know what a view is and how to make one. I also know what I\'ve used them f

相关标签:
14条回答
  • 2020-11-28 04:22

    Views save a lot of repeated complex JOIN statements in your SQL scripts. You can just encapsulate some complex JOIN in some view and call it in your SELECT statement whenever needed. This would sometimes be handy, straight forward and easier than writing out the join statements in every query.

    0 讨论(0)
  • 2020-11-28 04:23

    The responses so far are correct -- views are good for providing security, denormalization (although there is much pain down that road if done wrong), data model abstraction, etc.

    In addition, views are commonly used to implement business logic (a lapsed user is a user who has not logged in in the last 40 days, that sort of thing).

    0 讨论(0)
提交回复
热议问题