Native Relational Operations
Name |
Symbol |
Keyboard Form |
Example |
PROJECT |
R[ ] |
R[ ] |
R[ Ai1 ... Aik ] |
SELECT |
R where C |
R where C |
R where A1 = 5 |
JOIN |
∞ |
JOIN |
R∞S, or R JOIN S |
DIVISION |
÷ |
DIVIDEBY |
R÷S, or R DIVIDEBY S |
Projection
Assume
Head(R)=A1…An
.
The projection of
R
on attributes
Ai1,…,Aik
, where
{Ai1,…,Aik}⊆{A1,…,An}
is a table
T
whose heading is
Head(T)=Ai1…Aik
, with the following content.
For every row
r
in the table
R
there will be single row
t
in the table
T
such that
r[Aij]=t[Aij]
for every
Aij
contained in
{Ai1,…,Aik}
.
- The project of
R
on {Ai1,…,Aik}
is denoted by R[Ai1,…,Aik]
.
- Duplicate rows will be deleted until only one copy in the result of the projection.
customer |
cid |
cname |
city |
discnt |
c001 |
TipTop |
Duluth |
10.00 |
c002 |
Basics |
Dallas |
12.00 |
c003 |
Applied |
Dallas |
12.00 |
c004 |
ACME |
Duluth |
12.00 |
c006 |
ACME |
Kyoto |
0.00 |
|
⇒
CN := CUSTOMER[cname]
|
CN |
cname |
TipTop |
Basics |
Applied |
ACME |
|
|
|
My girlfriend’s dog died, so I tried to
cheer her up by getting her an identical one.
It just made her more upset.
She screamed at me,
“What am I supposed to do with two dead dogs?”
|