Let’s DELETE View
Now we are gonna delete the views which are called HighSalaryEmployees and TOP_EMPLOYEE.
DROP VIEW HighSalaryEmployees;
DROP VIEW TOP_EMPLOYEE;
Now for confirming again execute the query:
SELECT TABLE_SCHEMA, EMPLOYEES
FROM
INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA='GFG';
Output:
TABLE_SCHEMA |
EMPLOYEES |
---|---|
GFG |
GOOD_EMPLOYEE |
Explanation: This query retrieves information about views from the INFORMATION_SCHEMA.VIEWS table for a specific TABLE_SCHEMA (‘GFG’). It selects the TABLE_SCHEMA and EMPLOYEES columns from the VIEWS table, filtering the results to only include views from the ‘GFG’ schema.
SQL – DELETE View
SQL Views provide a powerful way to simplify complex queries and present data in a more understandable format. However, there may be times when we need to remove a view from your database schema. In SQL, the DELETE VIEW command does not exist. So we use the DROP VIEW command to delete a view.
In this article, We will learn about the SQL DROP VIEW with detail understanding with the help of examples and so on.