Database Reference
In-Depth Information
Figure 12.5. A partial sample of data from the CLASS ROSTER view
Youcanmodify most ofthedatawithinamultitabledataviewatanytime,andthemodific-
ations you make will flow through the view and into the base tables. Quite obviously, you
can'tmodifythevalueofanyprimarykeysthatyouincorporatefromthebasetables.Asin
the case of a single-table view, field specifications and business rules will determine what
types of modifications you can make to the data. (Again, be sure to check your RDBMS
documentation for any further constraints it may place upon your views.)
The redundant data in the CLASS ROSTER view (which you should have noticed) is the
result of merging a record from the CLASSES table with two or more records from the
STUDENTS table; the number of times a particular class name appears is equal to the
number of students that are registered to attend that class. This apparent redundancy is ac-
ceptable because the data is not physically stored in the view—rather, it is drawn from the
view'sbasetables,whereitisstoredinaccordancewiththerulesofproperdatabasedesign.
RDBMSs commonly display data from multitable views in this fashion.
Another point to note is that a data view does not contain its own primary key. It lacks a
primary key because it is not a table; a true table stores data and requires a primary key
to serve as a unique identifier for each of its records. You can incorporate a primary key
Search WWH ::




Custom Search