Notes
Slide Show
Outline
1
 
2
Chapter 6
  • The Relational Algebra and Relational Calculus
3
FIGURE 6.1
Results of SELECT and PROJECT operations. (a) s(DNO=4 AND SALARY>25000) OR (DNO=5 AND SLARY>30000)(EMPLOYEE). (b) pSEX, SALARY(EMPLOYEE).
4
FIGURE 6.2
Results of a sequence of operations. (a) pFNAME, LNAME, SALARY
(sDNO=5(EMPLOYEE)). (b) Using intermediate relations and renaming of attributes.
5
FIGURE≈6.3
Results of the UNION operation RESULT  € RESULT1  È RESULT2.
6
FIGURE≈6.4
The set operations UNION, INTERSECTION, and MINUS. (a) Two union-compatible relations. (b) STUDENT È INSTRUCTOR. (c) STUDENT Ç INSTRUCTOR. (d) STUDENT – INSTRUCTOR. (e) INSTRUCTOR – STUDENT
7
FIGURE≈6.5a
The CARTESIAN PRODUCT (CROSS PRODUCT) operation.
8
FIGURE≈6.5b
The CARTESIAN PRODUCT (CROSS PRODUCT) operation.
9
FIGURE≈6.5c
The CARTESIAN PRODUCT (CROSS PRODUCT) operation.
10
FIGURE≈6.6
Result of the JOIN operation DEPT_MGR ¬ DEPARTMENT JOIN MGRSSN=SSN EMPLOYEE .
11
FIGURE≈6.7
Results of two NATURAL JOIN operations. (a) PROJ_DEPT ¬ PROJECT * DEPT. (b) DEPT_LOCS ¬ DEPARTMENT * DEPT_LOCATIONS.
12
FIGURE≈6.8
The DIVISION operation. (a) Dividing SSN_PNOS by SMITH_PNOS. (b) T ¬ R ÷ S.
13
FIGURE≈6.9
The AGGREGATE FUNCTION operation.
14
FIGURE≈6.10
A two-level recursive query.
15
FIGURE≈6.11
The result of a LEFT OUTER JOIN operation.
16
FIGURE≈6.12
A relational database schema for a LIBRARY database.
17
FIGURE≈6.13
A database state for the relations T1 and T2.