The example shows C instantiated with the second tuple. Equivalently, we may sometimes say that C ‘holds’ a value instead of being instantiated with that value1. In any case, because variables like C range over tuples (or is only permitted to hold a tuple), they are termed tuple variables. Figure A tuple variable C ranging over the Customer relation A tuple has component parts, and unless we have a means of referring to such parts, the logical functions we formulate over relations will have limited expressive power. Given, for example, two variables X and Y that range over two different relations with a common domain, we may want to specify a condition where their current instantiations are such that the values under the common domain are identical. Thus while X (and Y) denote a tuple as a whole, we really wish to compare tuple component values. The syntactic mechanism provided for this purpose takes the form: <tuple-variable-name>.<attribute-name> and is interpreted to mean the value associated with <attribute-name> in the current instantiation of <tuple-variable-name>. Thus, assuming the instantiation of C as: C.C# = 2 C.Cname = ‘Martin’
Data Base Management systems 47 Notes Amity Directorate of Distance & Online Education ...etc This denotation of a particular data item within a tuple variable is often referred to as a projection of the tuple variable over a domain (eg. “C.Cname” is a projection of tuple variable C over the domain Cname). Relational Calculus is a collection of rules of inference of the form: <target list> : <logical expression> where <target list> is a list of free variables and/or their projections that are referenced in <logical expression>. This list is thought of as the “target list” because the set of instantiations of the list items that makes <logical expression> true is the desired result. In other words, an inference rule may be thought of as a query, and may be informally understood as a request to find all variable instantiations that satisfy <logical expression> and, for each such instantiation, to extract the data items mentioned in <target list>. 3.8.2 Quantifiers Logical expressions may also include variable quantifiers, specifically: 1. the existential quantifier, denoted by the symbol ‘$’, and 2. the universal quantifier, denoted by the symbol ‘”’ These quantifiers quantify variables. An existentially quantified variable, say x, is written “$x” and is read as “there exists an x such that...”. A universally quantified variable is written as “”x” and is read as “for all x...”. Quantification is applied to a formula and is written preceding it. For example, $x (x < y & y < 12) would be read as “there exists an x such that x is less than y and y is less than 12”. The formula to which the quantification is applied is called the scope of quantification. Occurrences of quantified variables in the scope of quantification are said to be bound (existentially or universally). The scope is normally obvious from the written expressions, but if ambiguities might otherwise arise, we will use parenthesis to delimit scope.
You've reached the end of your free preview.
Want to read all 14 pages?
- Winter '17
- DR Mubashir
- Relational Database