Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 12. Views

Chapter 12. Views

A view is a stored SELECT statement that returns a table whose data is derived from one or more other tables (called underlying tables). Some important characteristics of a view are:

  • A view’s underlying tables can be base tables, temporary tables, or other views.

  • A view is called a virtual or derived table to distinguish it from a base or temporary table.

  • The DBMS stores a view as only a SELECT statement, not as a set of data values, thus preventing data redundancy.

  • A view materializes dynamically as a physical table when referenced by name in an SQL statement. It exists only for the duration of the statement and vanishes when the statement ends.

  • A view consists of a set of named columns and rows of data, so you can use it almost anywhere you’d use a real table.

  • You have no restrictions on querying (SELECTing) through views. In some cases, views can be updated, causing the data changes to be passed through to the underlying base tables.

  • Because of closure, a view always is a single table no matter how many underlying tables it references or how those tables are combined; see the Tips in “Tables, Columns, and Rows” in Chapter 2.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint