![]() ![]() | testview | CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `testview` AS select `dispatches_data`.`ProductName` AS `ProductName`,`dispatches_data`.`CustomerName` AS `CustomerName`,`dispatches_data`.`DispatchTimeStamp` AS `DispatchTimeStamp`,`dispatches_data`.`Price` AS `Price`,`dispatches_data`.`Location` AS `Location` from `dispatches_data` | cp850 | cp850_general_ci |įollowing query alters the ALGORITHM of the table − | View | Create View | character_set_client | collation_connection | You can retrieve the definition of the above created view using the SHOW CREATE VIEW statement as shown below − Mysql> CREATE VIEW testView AS SELECT * FROM dispatches_data Insert into dispatches_data values('Headset', 'Jalaja', TIMESTAMP('', '10:49:27'), 6000, 'Goa') Īssume we have created a view using the CREATE VIEW statement as shown below − Insert into dispatches_data values('Earphones', 'Roja', TIMESTAMP('', '14:13:12'), 2000, 'Vishakhapatnam') Suppose we have created a table named dispatches_data with 5 records in it using the following queries − Where, name is the name of the view for which you need the CREATE statement. Syntaxįollowing is the syntax of the ALTER VIEW Statement The MySQL SHOW CREATE VIEW Statement displays the CREATE VIEW statement used to create the specified view. It is stored in the database with an associated name. ![]() A MySQL view is a composition of a table in the form of a predefined SQL query. ![]()
0 Comments
Leave a Reply. |