This statement is used to delete views.
1 | DROP VIEW [IF EXISTS] [db_name.]view_name; |
DROP: Deletes the metadata of a specified view. Although views and tables have many common points, the DROP TABLE statement cannot be used to delete views.
The to-be-deleted view must exist. If you run this statement to delete a view that does not exist, an error is reported. To avoid such an error, you can add IF EXISTS in this statement.
To delete a view named student_view, run the following statement:
1 | DROP VIEW student_view; |