Relational Algebra Flashcards

(32 cards)

1
Q

Enables users to specify basic retrieval requests as relational algebra expressions

A

Relational algebra

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

Two operation Groups

A
  1. Mathematical set theory
  2. Operation for relational databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Give some examples of set operations

A

Union
Intersection
Set difference
Cartesian product

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

Give some examples of Relational operations

A

Select
join
project
aggregate

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

Importance of relational operations

A
  1. Provides formal foundation for relational model operations
  2. Use as a basis for implementing and optimizing queries during the query process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Unary Relational Operations

A

Select and Project

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

Select

A

Ơ
chose a subset of the tuples from a relation that satisfies a given

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

The degree of the relation results from a select operation is the ________ as the number of attributes of R

A

same

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

Property of select

A

commutative

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

Project

A

π
select a certain columns or attributes from R disregarding other columns

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

Duplicates at project is removed by what process

A

Duplicate Eliminations

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

Uses sorting to detect duplicates if not eliminated creates multisets of tuples instead of a set

A

Duplicate Eliminations

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

Renaming operation

A

p
we can rename relations or attribute names

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

Properties of Project

A

Not Commutative

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

Set Theory

A

Merges two sets
Binary; two sets of tuples

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

Type compatibility or Union compatibility is checked where

15
Q

Intersection

A

the result of R ∩ S
a relation that includes all tuples that are both R and S

16
Q

Properties of Union and Intersection

A

Commutative
N-ary operations

17
Q

Set Difference

A

all tuples that are in R not in S

18
Q

Properties of Set Difference

A

Not Commutative
Intersection can be expressed in terms of union and set difference

19
Q

Cartesian product

A

Cross product
Binary Operation
Does not need to be union compatible
Combine every member tuple from one relation A with every member tuple of relation B

20
Q

Join Operator

A


longer tuples

21
Q

Inner join has 2 kinds

A

Equijoin
Natural

22
Q

Equijoin

A

=
One or more pairs of attributes that have identical values in every tuple

22
Outer join has 3 kinds
Left, right, full
23
Natural
equate each pair that have the same name and attributes
24
Properties of join
can be specified among multiple tables
25
Aggregate examples
Sum, Average, Max and minimum and count
26
Quary Trees
evaluation tree or quary execution tree includes relational algebra being executed possible data structure for representation query in rDBMS
27
input nodes
leaf nodes
27
relational algebra
internal nodes
28
How does a query tree work
1. implement the internal node operation whenever the operand is available 2. internal nodes are replaced with outputs of operations 3. execution terminates when root node is executed and produces the result relation of the query