Relational Algebra Flashcards

(44 cards)

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

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
Union Compatibility
Relations in question for a binary operation must have - Same degree (# of attributes) - Same domain
26
Cartesian Product
AKA Cross Join, binary set operation but doesn't force Union Compatibility
27
Symbol for Cartesian Product in Relational Algebra
X
28
Symbol for JOIN in Relational Algebra
29
JOIN
combine related tuples from two relations into single “longer” tuples. allows us to process relationships among relations
30
Notation for JOIN statement
DEPT_MGR ← DEPARTMENT ⋈ Mgr_ssn=Ssn EMPLOYEE
31
THETA JOIN
allows for arbitrary comparison relationships (such as ≥)
32
EQUIJOIN
a theta join using the equality operator (instead of comparison)
33
NATURAL JOIN
an equijoin on attributes that have the same name in each relationship.
34
Complete Set
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
Symbol for DIVISION in Relational Algebra
÷
36
DIVISION
Find the values that do not belong in the answer , and remove them from the list of possible answers.
37
Query Tree
data structure that corresponds to a relational algebra expression input relations of the query as leaf nodes relational algebra operations as internal nodes
38
Set of Aggregate Functions
COUNT, SUM, AVERAGE, MAXIMUM, and MINIMUM
39
Symbol for Aggregate Function in Relational Algebra
ℑ | script F
40
Recursive Closure
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
OUTTER JOIN
Join that maintains all the tuples of one or both relations
42
Range Relation
The relation a tuple "ranges over" (or belongs to)
43
Relational Calc Tuple Variable
A variable ranging over a relation that may take any value which is a tuple from that relation {t|COND(t)}
44
Parts of a Relational Calc Tuple
{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