MariaDB DROP VIEW Keyword
The MariaDB DROP VIEW statement is used to delete a MariaDB VIEW. A MariaDB VIEW is a virtual table created based on the MariaDB statement. A view contains rows and columns just like a normal table. All MariaDB functions, WHERE, HAVING and JOINs statements can be used to create a MariaDB VIEW. Finally, to delete a MariaDB VIEW, DROP VIEW keyword is used.
The syntax for using DELETE VIEW statement in MariaDB is given below:
DROP VIEW view_name;
Consider a database table called Employee with the following records:
The below mentioned MariaDB statement is used to create a view on Employee table which contains all records of employee whose salary is greater than 2800.
CREATE VIEW `Employee Salary GT 2800` AS SELECT * FROM Employee WHERE Salary > 2800;
After creating the VIEW, it can be used as mentioned below:
SELECT * FROM `Employee Salary GT 2800`;
This will produce the result as shown below:
The DROP VIEW keyword is used to delete a view.
DROP VIEW `Employee Salary GT 2800`;
❮ MariaDB Keywords