How can we drop a MySQL view from the database?

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


DROP VIEW [IF EXISTS] view_name;

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


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)

Updated on: 22-Jun-2020


Kickstart Your Career

Get certified by completing the course

Get Started