Database Design   «Prev  Next»

Lesson 9 Calculated fields
Objective Explain why calculated fields require user views.

Calculated Fields required for User Views

The tables actually stored in a database (called base tables) cannot have any type of calculations built into their fields. The reason for this is simple: every field in a base table uniquely and independently stores data about the subject of its table. If calculation were permitted in base tables, then the data stored in some fields would depend for their values on data stored in other fields.
User views, however, store their data in virtual tables[1] that consist of fields loaded into computer memory from base tables. Virtual tables themselves are not stored in the database; rather, the definition of the view is stored and given a name. Users call up that name, and the view is created (from base tables) on the fly. When a user closes the view, it disappears from memory, only to be recreated the next time its name is invoked. Users call up that name, and the view is created (from base tables) on the fly. When a user closes the view, it “disappears” from memory, only to be recreated the next time its name is invoked.

A user view (like a database application) allows calculations to be performed on the data contained in its fields. That is because these field calculations within virtual tables have no effect on the data stored in the base tables. One significant reason to create user views, then, is because, through calculations, views can deliver extremely useful information. The next lesson describes the documents created during Requirements Analysis.

Calculated Fields - Exercise

Before moving on to the next lesson, click the Exercise link below to check your understanding of calculated fields.
Calculated Fields - Exercise
[1]virtual table: A table stored in the computer’s memory.