Working with views
Views are queries that are saved in a database. They are mostly used in read-only format; only under some circumstances can they be used to update data in a table. Once a view has been created, it can be used in MySQL as if it were a table or linked to an external application, such as MS Access, as a table.
Views have multiple uses. Typically, you use a view when a query may be accessed more than once. For example, let's say we had a database of customers and their orders. The sales team may want to create a query that shows the total sales for each customer for a given year. We can save this query as a view to allow the sales team to access it whenever they need to. This also allows users who are not experienced with SQL to access data that is created using SQL queries, which ensures that the databases are as simple as possible for all users.
A view can be created using the following query:
CREATE VIEW `<View Name>` AS <Your query SQL here...