-1

MySQL Documentation explains how to create a view. However it doesn't explain why should I make a MySQL View in the first place.

Thus, my question is, what is MySQL View? What is it for? At what circumstances should I make or not make one?

Quoting the documentation

The view definition is “frozen” at creation time and is not affected by subsequent changes to the definitions of the underlying tables.

I don't see how creating a view would be beneficial, so please, enlighten me.

絢瀬絵里
  • 1,013
  • 2
  • 14
  • 27
  • Possible duplicate of [How do MySQL views work?](https://stackoverflow.com/questions/2878227/how-do-mysql-views-work) – Capsule Jun 13 '17 at 03:32
  • http://www.mysqltutorial.org/introduction-sql-views.aspx – Capsule Jun 13 '17 at 03:35
  • IMO Views in MySQL are of limited use, because they cannot use indexes. That said, it can occasionally be easier to manipulate a single view, rather than each of its underlying tables. – Strawberry Jun 13 '17 at 05:18

2 Answers2

1
  1. View the data without storing the data into the object.

  2. Restrict the view of a table i.e. can hide some of columns in the tables.

  3. Join two or more tables and show it as one object to user.

  4. Restrict the access of a table so that nobody can insert the rows into the table.

Komal K.
  • 450
  • 2
  • 13
-1

Where I work, we use the views as big painful querys that we need many times, we decided to create views for them instead of doing a manual query and when we need to access the information

SELECT * FROM view WHERE (anything)