Dropping a View with DROP VIEW

Use the DROP VIEW statement to destroy a view. As a view is physically independent of its underlying table(s), you can drop the view at any time without affecting the table(s). All SQL programs, applications, and other views that reference the dropped view will break, however.

To drop a view:

  • Type:
    DROP VIEW view;
    
    view is the name of the view to drop (Listing 12.17).
Listing 12.17. Drop the view ny_authors.
						DROP VIEW ny_authors;

✓ Tips

  • Dropping a table doesn’t drop the views that reference that table, so you must drop the views with DROP VIEW explicitly; see “Dropping a Table with DROP TABLE” in Chapter 10.

  • SQL has no ALTER VIEW statement. If the underlying table(s) or view(s) changed since a view was created, ...

Get SQL: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.