Difference between View and table in sql

后端 未结 7 1479
别那么骄傲
别那么骄傲 2020-12-02 05:45

Possible Duplicate:
Difference Between Views and Tables in Performance

What is the main difference between vi

7条回答
  •  旧巷少年郎
    2020-12-02 06:02

    Table: Table is a preliminary storage for storing data and information in RDBMS. A table is a collection of related data entries and it consists of columns and rows.

    View: A view is a virtual table whose contents are defined by a query. Unless indexed, a view does not exist as a stored set of data values in a database. Advantages over table are

    • We can combine columns/rows from multiple table or another view and have a consolidated view.
    • Views can be used as security mechanisms by letting users access data through the view, without granting the users permissions to directly access the underlying base tables of the view
    • It acts as abstract layer to downstream systems, so any change in schema is not exposed and hence the downstream systems doesn't get affected.

提交回复
热议问题