Relational Algebra Flashcards

1
Q

Projection

A
  • Extracts attributes from a relation
  • pi_{attributes}(relation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Selection

A
  • Selects tuples from a relation that match a predicate
  • sigma_{predicate}(relation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Cartesian Product

A
  • Forms a new relation containing all possible combinations of tuples from R_{1} with tuples from R_{2}
  • R_{1} x R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Natural Join

A
  • Performs a filtered Cartesian product, removing tuples in which attributes with the same name have different values, and keeping only one copy of each duplicated column
  • R_{1} |x| R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Condition (Theta) Join

A
  • Performs a filtered Cartesian product according to a specified predicate
  • R_{1} |x|{Theta} R{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Left Outer Join

A
  • In addition to the natural-join tuples, include an extra tuple for each tuple from R_{1} with no match in R_{2}
  • In the extra tuples, assign the R_{2} attributes NULL
  • R_{1} -|x| R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Right Outer Join

A
  • In addition to the natural-join tuples, include an extra tuple for each tuple from R_{2} with no match in R_{1}
  • In the extra tuples, assign the R_{1} attributes NULL
  • R_{1} |x|- R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Full Outer Join

A
  • In addition to the natural-join tuples, include an extra tuple for each tuple from R_{2} with no match in R_{1}
  • In the extra tuples, assign the R_{1} attributes NULL
  • R_{1} -|x|- R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Set Difference

A
  • Select tuples that are in one relation but not the other
  • The relations must have the same number of attributes
  • Corresponding attributes must have the same domain
  • R_{1} - R_{2}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Assignment

A
  • Assigns the result of an operation to a temporary variable or an existing relation
  • Relation <– expression
How well did you know this?
1
Not at all
2
3
4
5
Perfectly