How can we drop a MySQL view from the database?

MySQLMySQLi Database

With the help of DROP VIEW statement, we can drop a MySQL view from the database. Its syntax would be as follows −

Syntax

DROP VIEW [IF EXISTS] view_name;

Here view_name is the name of the view which we want to delete from the database.

Example

Suppose if we want to drop a view named info_less then the following query will delete if −

mysql> DROP VIEW IF EXISTS Info_less;
Query OK, 0 rows affected (0.03 sec)
raja
Published on 22-Feb-2018 10:25:53
Advertisements