Sql Views Advantages

Question

What is a database view. Mention few database sql views advantages

SQL query optimization

Answer

A view is a virtual table (not part of the physical schema) composed from the result set of a stored query. Views contain dynamic content. This means if you modify the physical tables from which the view is constructed then the data shown in subsequent invocations of the view will change as well.

Sql views advantages

  1. Views allow us to work on a subset of a database table instead of working on the whole table
  2. Using views we can construct a single virtual table from multiple physical tables
  3. Views can be used to aggregate data for example sum and average
  4. We can virtually partion a given table into different logical pieces
  5. Views occupy less space because only the defintion of the view is stored
  6. Views can provide extra security (depends on the implementation)
  7. Views can be used to control database tables exposure to the outside world

Please use the comments section below for questions, corrections or feedback. Thanks for reading.

Tags:

Add a Comment

Your email address will not be published. Required fields are marked *