Relational Calculus Flashcards

1
Q

First order logic is propositional logic with _________

A

quantifiers

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

A _____ variable is a variable not defined by a quantifier

A

free

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

________ queries are queries without free variables

A

boolean

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

______ defines whether a formula is true or false given a description of the database

A

semantics

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

What is Codd’s theorem?

A

Relational Algebra and Relational Calculus have essentially the same expressive power

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

For every _______ ______ E, there is an equivalent relational calculus expression

A

relational expression

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

When converting from RA to RC, the _________ v function maps each attribute A in the schema to a variable X_A

A

environment

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

If R is a base relation over A,B
ν={A |→ x_A, B |→ x_B, …}
then R is translated to …

A

R(x_A,x_B)

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

What are the three steps to convert renaming from RA to RC?

A
  • Translate E to φ
  • If there is no mapping for B in ν, add{B |→ x_B}
  • Replace every occurrence of ν(A) in φ by ν(B)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

From RA to RC, projection is translated as…

A

π_L (E) is translated to∃X φ, where X are attributes that are NOT projected

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

From RA to RC, Selection is translated as…

A

σθ(E) is translated to φ∧ν(θ), where ν(θ) is obtained from θ by replacing each attribute A by ν(A)

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

Convert σ_(A=B)(R) to RC

A

R(x_A,x_B)∧x_A=x_B

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

From RA to RC, Cartesian Product is translated as…

A

conjuction

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

From RA to RC, _____ is translated as disjunction

A

union

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

From RA to RC, difference is translated as…

A

A ^ -B

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

Can every RC expression be converted into an RA expression?

A

NO

17
Q

Whether a RC query is ____ is undecidable

A

safe

18
Q

The ADOM(R) =

A

all unique constants occurring in R

19
Q

Only ______ RC can be converted to RA

A

safe

20
Q

When is RC safe?

A

Adom(Q(D))⊆Adom(D)

21
Q

From RC to RA, how do you translate predicate symbols?

A

R(x_1,…,x_n) is translated to ρ_(A_1→ν(x_1),…,A→ν(xn))(R)

22
Q

From RC to RA, how do you translate existential quantification?

A

∃x φis translated to π_ν(X−{x})(E) where X=free(φ)

23
Q

From RC to RA, how do you translate comparisons?

A

x op y is translated to σ_(ν(x) op ν(y) (Adomν(x)×Adomν(y)) and
x op c is translated to σ_(ν(x) op c) (Adomν(x))

24
Q

From RC to RA, how do you translate negations?

A

¬φ is translated into (X_(x∈free(φ))Adomν(x))−E

25
Q

From RC to RA, how do you translate Disjunction?

A

φ1∨φ2 is translated toE_1x(X_(x∈X2−X1)Adomν(x))∪E2x(X_(x∈X1−X2)Adomν(x))