Relational Algebra Flashcards

1
Q

Unary Relational Operations

A

Operations on one set:

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Select: σ

A

Selects entire entries from a table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Project: π

A

Selects only specified attributes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Rename: ρ

A

Renames attributes or entities

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Binary Operations:

A

Operations on two sets:

Union: U
Intersection: ∩
Set Difference: -

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Union

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Intersection

A

Includes all tuples in R and S

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Set Difference:

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Commutative Operatiosn

A

Union and Intersection

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Joins:

A

Binary Operators:

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Cartesian Product / Cross Product

A

Exhausting pairing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Theta Join

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Equijoin

A

A join based on only strict equality pairing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Natural Join

A

Removes superfluous attributes in an equijoin situation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Outer Joins

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Left Outer Join

A

Keep every tuple in the left relation, pad with nulls

17
Q

Right Outer Join

A

Keep every tuple in the right relation, pad with nulls

18
Q

Full Outer Join

A

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

19
Q

Aggregate Functions

A
F(Max)
F(Min)
F(Sum)
F(Count)
F(Average)
20
Q

Grouping with Aggregate Functions

A

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

DNO F(AVERAGE)SAL(EMP)

Groups by the DNO

21
Q

Query Trees

A

A data structure that corresponds to the relation algebra expression