the a lgebra and the calculus
DESCRIPTION
The a lgebra and the calculus. …their correspondence and their differences. Kifer et all: http:// www.amazon.com / gp /product/0321228383/ref=s9_simh_gw_p14_d1_i3?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SF508JN5HZFRECYND6V&pf_rd_t=101&pf_rd_p=1389517282&pf_rd_i=507846. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/1.jpg)
1
The algebra and the calculus…their correspondence and their differences
![Page 2: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/2.jpg)
2
Some of this material was taken from
Kifer et all:http://www.amazon.com/gp/product/0321228383/ref=s9_simh_gw_p14_d1_i3?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=center-2&pf_rd_r=0SF508JN5HZFRECYND6V&pf_rd_t=101&pf_rd_p=1389517282&pf_rd_i=507846
![Page 3: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/3.jpg)
3A domain is
The set of all allowable values that a function can act on and return a meaningful result.
![Page 4: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/4.jpg)
4A calculus is
• Any system of calculating• Apparently, the word come from Latin word for rock and
early folks did their counting with piles of rocks. • When we were in high school, it was the mathematics
that deals with the concept of change, like the slope of a curve, as opposed to the slope of a line• Line is delta-y/delta-x• Curve varies in slope depending on where you are in the
curve
![Page 5: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/5.jpg)
5SQL
• It is a tuple calculus• Variables represent conceptual tuples from a table, derived
table, or singleton• One can also create domain calculi
![Page 6: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/6.jpg)
6Tuple calculus
Form of query:{T | Condition(T)}
T is the target – a variable that ranges over tuples of valuesCondition is the body of the query
Involves T (and possibly other variables)Evaluates to true or false if a specific tuple is substituted for T
![Page 7: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/7.jpg)
7Example
{T | Teaching(T) AND T.Semester = ‘F2000’}Is the same as:SELECT *FROM Teaching TWHERE T.Semester = ‘F2000’
![Page 8: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/8.jpg)
8Domain calculus
• A domain variable is a variable whose value is drawn from the domain of an attribute • Contrast this with a tuple variable, whose value is an entire
tuple• Example: The domain of a domain variable Crs might be
the set of all possible values of the CrsCode attribute in the relation Teaching
![Page 9: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/9.jpg)
9
Domain calculus expression
{X1 , …, Xn | condition(X1 , …, Xn) }
{Pid, Code | Teaching(Pid, Code, ‘F1997’)}
![Page 10: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/10.jpg)
10Example
• Algebra: R – S• TRC: {T | R(T) AND NOT S(T)}• DRC: {A,B,C | R(A,B,C) AND NOT S(A,B,C) }
![Page 11: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/11.jpg)
11
More complete example
![Page 12: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/12.jpg)
12Another example
![Page 13: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/13.jpg)
13A visual interface
• Declarative query language, like SQL• Based on DRC (rather than TRC)• Visual
![Page 14: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/14.jpg)
14
In a more formal form
![Page 15: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/15.jpg)
15The QBE interface
• Print all professors’ names in the MGT department
Professor Id Name DeptId
P._John MGT
![Page 16: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/16.jpg)
16
Return all attributes
Professor Id Name DeptId
• MGTP.
![Page 17: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/17.jpg)
17Joins
![Page 18: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/18.jpg)
18Condition boxes
![Page 19: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/19.jpg)
19Insert a tuple
![Page 20: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/20.jpg)
20A bigger example
![Page 21: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/21.jpg)
21
Other table based DBs: Microsoft Access
![Page 22: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/22.jpg)
22Example
![Page 23: The a lgebra and the calculus](https://reader036.vdocuments.mx/reader036/viewer/2022081502/568162be550346895dd34c11/html5/thumbnails/23.jpg)
23Filemaker