Views Flashcards
Relational table
Description of a table, including a list of attributes together with any integrity constraints, primary and foreign key, etc…,
Relational Variable
Actual table with data in it
It is a variable because if any data is added, removed or updated in it, its actual VALUE changes –> like a variable in any programming language
Base Relational Variable
Relational variable that exists as some form of physical data, stored somehow
Derived Relational Variable
Does not ever exist physically
Remains as a description (expression), evaluated when it is encountered in a program
TYPICALLY OBSERVED USING VIEWS -> views enable derived variables to exist temporarily, for certain purposes, without ever being stored for longer than is needed
User not necessarily aware that they are using a view, rather than a table –> has the same type as Base RV –> has the same closure properties as a table
Views are not evaluated, but stored in the catalog under a given name
Understanding Views
Views are not evaluated, but are stored in the catalog under a given name
Alterations in the underlying data from which the View is built, are immediately reflected in the View
Alterations made to the data in the view are also reflected in the underlying data
Reasons for using views
1) Concurrency: Lots of different users can view data in different ways –> can create views for different perspectives / different roles that people are in
2) Security: If user is only allowed to see a particular subset of some data, then only give them access to a specific subset that exists
3) Logical Independence: Views make your database robust to changes –> underlying structure of database may change, but views keep access consistent