| Elmasri/Navathe (3rd) ed. | Kroenke (7th ed.) | Connolly/Begg (3rd Ed.) | Rob/Coronel (5th ed) | Hoffer, Prescott & McFadden (6th ed.) | Mata-Toledo / Cushman |
|---|---|---|---|---|---|
| Chapter 7 | Chapter 8 | Chapter 4 | N/A | N/A | Shaum's Outlines Ch. 2 |
| First | Last | Age |
|---|---|---|
| Bill | Smith | 22 |
| Sally | Green | 28 |
| Mary | Keen | 23 |
| Tony | Jones | 32 |
| First | Last | Age |
|---|---|---|
| Forrest | Gump | 36 |
| Sally | Green | 28 |
| DonJuan | DeMarco | 27 |
S
S
R
S
| First | Last | Age |
|---|---|---|
| Bill | Smith | 22 |
| Sally | Green | 28 |
| Mary | Keen | 23 |
| Tony | Jones | 32 |
| Forrest | Gump | 36 |
| DonJuan | DeMarco | 27 |
R - S
| First | Last | Age |
|---|---|---|
| Bill | Smith | 22 |
| Mary | Keen | 23 |
| Tony | Jones | 32 |
R
S
| First | Last | Age |
|---|---|---|
| Sally | Green | 28 |
| fName | lName | Score |
|---|---|---|
| William | Smith | 44 |
| Sally | Green | 28 |
| Mary | Kontrary | 27 |
T
TR
| First | Last | Age |
|---|---|---|
| Bill | Smith | 22 |
| Mary | Keen | 23 |
| Tony | Jones | 32 |
S
| Dinner | Dessert |
|---|---|
| Steak | Ice Cream |
| Lobster | Cheesecake |
R X S
| First | Last | Age | Dinner | Dessert |
|---|---|---|---|---|
| Bill | Smith | 22 | Steak | Ice Cream |
| Bill | Smith | 22 | Lobster | Cheesecake |
| Mary | Keen | 23 | Steak | Ice Cream |
| Mary | Keen | 23 | Lobster | Cheesecake |
| Tony | Jones | 32 | Steak | Ice Cream |
| Tony | Jones | 32 | Lobster | Cheesecake |
C (R) Returns only those tuples
in R that satisfy condition C
|
|
|
| Name | Office | Dept | Rank |
|---|---|---|---|
| Smith | 400 | CS | Assistant |
| Jones | 220 | Econ | Adjunct |
| Green | 160 | Econ | Assistant |
| Brown | 420 | CS | Associate |
| Smith | 500 | Fin | Associate |
Dept = 'CS' (EMP)| Name | Office | Dept | Rank |
|---|---|---|---|
| Smith | 400 | CS | Assistant |
| Brown | 420 | CS | Associate |
Name = 'Smith'
Rank = 'Assistant' (EMP)| Name | Office | Dept | Rank |
|---|---|---|---|
| Smith | 400 | CS | Assistant |
Rank = 'Assistant'
Dept = 'Econ' (EMP)| Name | Office | Dept | Rank |
|---|---|---|---|
| Smith | 400 | CS | Assistant |
| Jones | 220 | Econ | Adjunct |
| Green | 160 | Econ | Assistant |
(Rank = 'Adjunct'
Dept = 'CS') (EMP)| Name | Office | Dept | Rank |
|---|---|---|---|
| Green | 160 | Econ | Assistant |
| Smith | 500 | Fin | Associate |
(Rank = 'Adjunct'
Dept = 'CS') (EMP)
Rank = 'Associate' (
Dept = 'CS' EMP )
Dept = 'CS' (
Rank = 'Associate' EMP )
Rank = 'Associate'
Dept = 'CS' (EMP)
Age > 26 (R
S)
For this expression, use R and S from the Set Theoretic Operations section above.
attributes R
name, dept (EMP)| Name | Dept |
|---|---|
| Smith | CS |
| Jones | Econ |
| Green | Econ |
| Brown | CS |
| Smith | Fin |
name (
Dept = 'CS' (EMP) )| Name |
|---|
| Smith |
| Brown |
name, rank (
(Rank = 'Adjunct'
Dept = 'CS') (EMP) )| Name | Rank |
|---|---|
| Green | Assistant |
| Smith | Associate |
name, rank (
(Rank = 'Adjunct'
Dept = 'CS') (EMP) )
fname, age (
Age > 22 (R
S) )
For this expression, use R and S from the Set Theoretic Operations section above.
office > 300 (
name, rank (EMP))
as in the
Elmasri/Navathe book.
| Name | Office | Dept | Salary |
|---|---|---|---|
| Smith | 400 | CS | 45000 |
| Jones | 220 | Econ | 35000 |
| Green | 160 | Econ | 50000 |
| Brown | 420 | CS | 65000 |
| Smith | 500 | Fin | 60000 |
MIN (salary) (EMP)| MIN(salary) |
|---|
| 35000 |
AVG (salary) (EMP)| AVG(salary) |
|---|
| 51000 |
COUNT (name) (
Dept = 'CS' (EMP) )| COUNT(name) |
|---|
| 2 |
SUM (salary) (
Dept = 'Econ' (EMP) )| SUM(salary) |
|---|
| 85000 |
EMP.Dept = DEPART.Dept DEPART
| Dept | MainOffice | Phone |
|---|---|---|
| CS | 404 | 555-1212 |
| Econ | 200 | 555-1234 |
| Fin | 501 | 555-4321 |
| Hist | 100 | 555-9876 |
emp.Dept = depart.Dept DEPART| Name | Office | EMP.Dept | Salary | DEPART.Dept | MainOffice | Phone |
|---|---|---|---|---|---|---|
| Smith | 400 | CS | 45000 | CS | 404 | 555-1212 |
| Jones | 220 | Econ | 35000 | Econ | 200 | 555-1234 |
| Green | 160 | Econ | 50000 | Econ | 200 | 555-1234 |
| Brown | 420 | CS | 65000 | CS | 404 | 555-1212 |
| Smith | 500 | Fin | 60000 | Fin | 501 | 555-4321 |
(emp.office < depart.mainoffice)
(emp.dept = depart.dept) DEPART| Name | Office | EMP.Dept | Salary | DEPART.Dept | MainOffice | Phone |
|---|---|---|---|---|---|---|
| Smith | 400 | CS | 45000 | CS | 404 | 555-1212 |
| Green | 160 | Econ | 50000 | Econ | 200 | 555-1234 |
| Smith | 500 | Fin | 60000 | Fin | 501 | 555-4321 |
| Name | Office | Dept | Salary | MainOffice | Phone |
|---|---|---|---|---|---|
| Smith | 400 | CS | 45000 | 404 | 555-1212 |
| Jones | 220 | Econ | 35000 | 200 | 555-1234 |
| Green | 160 | Econ | 50000 | 200 | 555-1234 |
| Brown | 420 | CS | 65000 | 404 | 555-1212 |
| Smith | 500 | Fin | 60000 | 501 | 555-4321 |
includes all tuples
in the left hand relation and includes only those
matching tuples from the right hand relation.
includes all tuples
in the right hand relation and includes ony those
matching tuples from the left hand relation.
includes all tuples
in the left hand relation and from the right hand relation.
PEOPLE:
|
MENU:
|
people.food = menu.food MENU
| Name | Age | people.Food | menu.Food | Day |
|---|---|---|---|---|
| Alice | 21 | Hamburger | Hamburger | Tuesday |
| Bill | 24 | Pizza | Pizza | Monday |
| Carl | 23 | Beer | NULL | NULL |
| Dina | 19 | Shrimp | NULL | NULL |
people.food = menu.food MENU
| Name | Age | people.Food | menu.Food | Day |
|---|---|---|---|---|
| Bill | 24 | Pizza | Pizza | Monday |
| Alice | 21 | Hamburger | Hamburger | Tuesday |
| NULL | NULL | NULL | Chicken | Wednesday |
| NULL | NULL | NULL | Pasta | Thursday |
| NULL | NULL | NULL | Tacos | Friday |
people.food = menu.food MENU
| Name | Age | people.Food | menu.Food | Day |
|---|---|---|---|---|
| Alice | 21 | Hamburger | Hamburger | Tuesday |
| Bill | 24 | Pizza | Pizza | Monday |
| Carl | 23 | Beer | NULL | NULL |
| Dina | 19 | Shrimp | NULL | NULL |
| NULL | NULL | NULL | Chicken | Wednesday |
| NULL | NULL | NULL | Pasta | Thursday |
| NULL | NULL | NULL | Tacos | Friday |
*
* MENU
| Name | Age | Food | Day |
|---|---|---|---|
| Alice | 21 | Hamburger | NULL |
| Bill | 24 | Pizza | NULL |
| Carl | 23 | Beer | NULL |
| Dina | 19 | Shrimp | NULL |
| NULL | NULL | Hamburger | Monday |
| NULL | NULL | Pizza | Tuesday |
| NULL | NULL | Chicken | Wednesday |
| NULL | NULL | Pasta | Thursday |
| NULL | NULL | Tacos | Friday |
When doing homework assignments and projects, it is very helpful to
be able to type these relational algebra symbols into MS Word or
other work processor. Since we mainly use MS Word or another
word processor running in Microsoft Windows, we demonstrate
them here.
Most of the relational algebra symbols can be produced using the
"Symbol" font. One way to do this is to use the Symbol
choice on the Insert menu in MS Word. This is shown
below:
The following dialog box will appear:
By default, the symbols displayed on this screen will
use the Symbol font.
Some symbols such as join and outer join are not available in this
fashion. For these you can copy and paste the graphics
in the MS Word file linked here.
All of the relational algebra symbols are included.
How to make Relational Algebra Symbols in MS Word
File: ra_index.html Date: Mon Feb 18 09:54:01 EST 2002
All materials Copyright, 1997-2002 Richard Holowczak