MYSQL VIEW Query
Mysql support view from version 5.x, View features gives the sign of
SQL standard 2003.
View is nothing but a virtual table on based on result set of an MYSQL statement. Its also have rows and column like a real table but the field s in view may be one or more than one tables in the same database. we can apply MYSQL function on view it seems like a single table.
View queries process in two ways:-
* MYSQL support creating a temporary table based on query which makes
the views and then execute the input query on this temporary table
*MYSQL firstly combine the view and input query then executes the
MYSQL also support nested view. In the select statement of view we can
reference to another view.
In a cached enable system view is stored in the cache. As a result performing of query is fast becuase its fetch data from the buffering instead of physical hard disk.
SHOW statement is use to display view defined. The syntax is
SHOW CREATE VIEW Databasename.viewname;
view shows latest updated data in the sql query result because database engine recreate data view sql statement.
CREATE VIEW viewname As Select columnnames from tablename ;
CREAT OR REPLACE VIEW viewname AS Select columnames from tablename ;
DROP VIEW viewname;
we can delete a already existing view with DROP VIEW MYSQL query.