Dropping a View

The DROP VIEW command is used to drop a view from the database. There are two options to the DROP VIEW command: RESTRICT and CASCADE. If a view is dropped with the RESTRICT option, when any other views are referenced in a constraint, the DROP VIEW errs. If the CASCADE option is used and another view or constraint is referenced, the DROP VIEW succeeds and the underlying view or constraint is also dropped. An example follows:

						DROP VIEW NAMES2;
					
View dropped.

Get Sams Teach Yourself SQL in 24 Hours, Second Edition 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.