18.1. VIEWs in Queries

The Standard SQL syntax for the VIEW definition is

CREATE VIEW <table name> [(<view column list>)]
AS <query expression>
[WITH [<levels clause>] CHECK OPTION]

<levels clause> ::= CASCADED | LOCAL

The <levels clause> option in the WITH CHECK OPTION did not exist in SQL-89, and it is still not widely implemented. Section 18.5 of this chapter will discuss this clause in detail. This clause has no effect on queries, but only on UPDATE, INSERT INTO, and DELETE FROM statements.

A VIEW is different from a TEMPORARY TABLE, a derived table, or a base table. You cannot put constraints on a VIEW, as you can with base and TEMPORARY tables. A VIEW has no existence in the database until it is invoked, while a TEMPORARY TABLE is persistent. ...

Get Joe Celko's SQL for Smarties, 3rd 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.