When talking about database one of the most common items to work are the Views, with them it is possible to optimize the return time of a given query that comes to be allocated in a separate space in the database and thus ensures secure greater processing performance for database and application.

View is primarily used to return query more complex and thus optimizes it, tables that have many records or queries involving more than one table are typical examples of the use of views.

Create a view in MySQL is very simple, just use the following syntax:

CREATE VIEW [View Name]

AS

[Query]

As a practical example we will create a view that returns only products from a table that have the word “TV” in the name.

CREATE VIEW vw_TvQuery

AS

SELECT cod_prod, Name

FROM tbl_product

WHERE Name LIKE ‘%tv%’

To access view just use the select command, just as it makes a table query.

SELECT * FROM vw_TvQuery

mysql

Every day is more common to see MySQL being worked with PHP development projects WEB. So understand its operation ends up being essential for anyone working in this market.

Meet at our official site the advantages of working with PHP and MySQL by clicking the link above.

You might also like…

PROCESAMIENTO AJAX EN SCRIPTCASE

Ajax en los formularios de Scriptcase puede usarse para recargar un campo de tipo de select basado e...

IMPORTAR IMAGENES DE LA BASE DE DATOS Y UTILIZAR CLASES DE BOOSTRAP

Como muchas personas ya saben, Bootstrap es una biblioteca de front-end libre y de código abierto p...

TENDENCIAS DE DESARROLLO WEB PARA 2017

Usted verá en este post tendencias para 2017 en Diseño Web, en el medio digital y en el desarrollo...

Comment this post

Get new posts, resources, offers and more each week.

We will use the information you provide to update you about our Newsletter and Special Offers. You can unsubscribe any time you want by clinck in a link in the footer of any email you receive from us, or by contacting us at sales@scriptcase.net. Learn more about our Privacy Police.