Relational Algebra Flashcards Preview

Databases > Relational Algebra > Flashcards

Flashcards in Relational Algebra Deck (21):
1

Unary Relational Operations

Operations on one set:

Select: sigma: σ
Project: pi: π
Rename: rho: ρ

2

Select: σ

Selects entire entries from a table

3

Project: π

Selects only specified attributes

4

Rename: ρ

Renames attributes or entities

5

Binary Operations:

Operations on two sets:

Union: U
Intersection: ∩
Set Difference: -

6

Union

Includes all tuples from R and S, or R, or S

7

Intersection

Includes all tuples in R and S

8

Set Difference:

Includes all the tuples in R but not S (R-S)

9

Commutative Operatiosn

Union and Intersection

10

Joins:

Binary Operators:

Cross Product: X
Theta: Θ
Equi-join Θ=
Natural Join: *

11

Cartesian Product / Cross Product

Exhausting pairing

12

Theta Join

A join based on any sort of equality, can be combined with ANDs

13

Equijoin

A join based on only strict equality pairing

14

Natural Join

Removes superfluous attributes in an equijoin situation

15

Outer Joins

Keeps tuples in R even if they aren't in S

16

Left Outer Join

Keep every tuple in the left relation, pad with nulls

17

Right Outer Join

Keep every tuple in the right relation, pad with nulls

18

Full Outer Join

Keeps every tuple in right and left relation regardless of matches, pad with nulls

19

Aggregate Functions

F(Max)
F(Min)
F(Sum)
F(Count)
F(Average)

20

Grouping with Aggregate Functions

Given a relation: EMP(EMPNO, DNO, SAL)

DNO F(AVERAGE)SAL(EMP)

Groups by the DNO

21

Query Trees

A data structure that corresponds to the relation algebra expression