Relational Algebra Flashcards

1
Q

Relational Calculus

A

Higher level, declarative language for relational Databases

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

Product of Relational Calculus operation

A

New Relation

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

Elements of Relational Calculus

A

Tuples and Domain

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

Relational Algebra

A

A procedural query language, which takes instances of relations as input and yields instances of relations as output

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

Groups of Relational Algebra

A

Set theory operations and relational db specific operations

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

Operations in Relational Algebra Set Ops

A

UNION, INTERSECTION, DIFFERENCE (MINUS), CARTESIAN PRODUCT (CROSS JOIN)

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

Operations in Relational DB Ops

A

SELECT, PROJECT, JOIN, RENAME

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

Unary Operations

A

Operations that apply on a single relation (SELECT, PROJECT)

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

Binary Operations

A

Operate on two relations by combining related tuples (JOIN)

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

Aggregate Functions

A

Operations that summarize data from Tables or Joins (SUM, COUNT)

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

Selectivity

A

Fraction of tuples selected by a Selection Condition

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

Selection Condition

A

Statement of what data for a Select statement to display

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

Symbol for SELECT in Relational Algebra

A

σ

Sigma

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

Symbol for Relation in Relational Algebra

A

R

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

Degree in SELECT

A
# of attributes in a Relation
(Same as the degree of R)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Cascade

A

Sequence of SELECT statements with a Conjuntive (AND, OR)

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

Commutative

A

σ (σ(R)) = σ(σ(R))

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

PROJECT

A

Selects columns from a relation. All tuples are DISTINCT

19
Q

Symbol for PROJECT in Relational Algebra

A

π

Pi

20
Q

Degree in PROJECT

A

of attributes in a Relation

21
Q

Multiset

A

Set of tuples with duplicates. AKA “bag”

22
Q

In-Line Expression

A

Single line of Relational Algebra depicting results that don’t have a given name.

23
Q

RENAME

A

Renames a relation or attribute name, aka AS

24
Q

Symbol for RENAME in Relational Algebra

A

ρ or ϱ, with S as relation name or B as attribute name

Rho

25
Q

Union Compatibility

A

Relations in question for a binary operation must have

  • Same degree (# of attributes)
  • Same domain
26
Q

Cartesian Product

A

AKA Cross Join, binary set operation but doesn’t force Union Compatibility

27
Q

Symbol for Cartesian Product in Relational Algebra

A

X

28
Q

Symbol for JOIN in Relational Algebra

A

29
Q

JOIN

A

combine related tuples from two relations
into single “longer” tuples.
allows us to process relationships
among relations

30
Q

Notation for JOIN statement

A

DEPT_MGR ← DEPARTMENT ⋈ Mgr_ssn=Ssn EMPLOYEE

31
Q

THETA JOIN

A

allows for arbitrary comparison relationships (such as ≥)

32
Q

EQUIJOIN

A

a theta join using the equality operator (instead of comparison)

33
Q

NATURAL JOIN

A

an equijoin on attributes that have the same name in each relationship.

34
Q

Complete Set

A

the set of relational algebra operations {σ,π,∪,ρ,–,×}

any of the other original relational algebra operations can be
expressed as a
sequence of operations from this set

For example, the INTERSECTION operation can be expressed by using UNION and MINUS as follows:
R∩S≡(R∪S) – ((R–S)∪(S–R))

35
Q

Symbol for DIVISION in Relational Algebra

A

÷

36
Q

DIVISION

A

Find the values that do not belong in the answer , and remove them from the list of possible answers.

37
Q

Query Tree

A

data structure that corresponds to a relational algebra expression

input relations of the query as
leaf nodes

relational algebra operations as internal nodes

38
Q

Set of Aggregate Functions

A

COUNT, SUM, AVERAGE, MAXIMUM, and MINIMUM

39
Q

Symbol for Aggregate Function in Relational Algebra

A

script F

40
Q

Recursive Closure

A

applied to a recursive relationship between tuples of the same type

example of a recursive operation is to retrieve all supervisees of an employee (e) at all levels—that is, all employees (e’) directly supervised by e all employees
e’’ ℑ directly supervised by each employee e’, all employees e’’’ directly supervised by each employee e’’, etc
,

41
Q

OUTTER JOIN

A

Join that maintains all the tuples of one or both relations

42
Q

Range Relation

A

The relation a tuple “ranges over” (or belongs to)

43
Q

Relational Calc Tuple Variable

A

A variable ranging over a relation that may take any value which is a tuple from that relation

{t|COND(t)}

44
Q

Parts of a Relational Calc Tuple

A

{t.Fname,t.Lname | EMPLOYEE(t) AND t.Salary>50000}

range relation - EMPLOYEE(t)
selected combination - t.Salary > 50000
requested attribute - t.Fname, t.Lname