7.11. Views

A view is a virtual table derived from one or more tables or other views. It is virtual because it does not contain any data, but a definition of a table based on the result of a SELECT statement. Figure 7.21 illustrates view view1 derived from table table1.

Figure 7.21. A view derived from a table

A view does not need to contain all the columns of the base table. Its columns do not need to have the same names as the base table, either. This is illustrated in Figure 7.21, where the view consists of only two columns, and the first column of the view has a different name than the corresponding column in the base table. This is particularly ...

Get Understanding DB2®: Learning Visually with Examples 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.