Lecture 2 Flashcards

1
Q

What is πA1, A2, …, An(R)?

A

This is the projection, that denotes a relation based on R, that only comprimises only attributes A1, A2, A3, …, An from R

E.g. πtitle(Movies) would only return a tuple of movie titles

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

What is σC(R)?

A

Returns a new relation on R which comprises only tuples from R that meet condition C

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

What is a Cartesian product?

A

A x B = {(a, b) | a in A and b in B}

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

What is the Natural Join?

A

You naturally combine the tuples that match along the attributes that are both in the schema of R and S

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

What is a Theta-Join?

A

Join if a certain condition is equal

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

What is the notation to rename?

A

ρS(B1, B2, …, Bn​) (R), this renames R to B

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

What is a superkey?

A

Any set of values that is able to uniquely identify a row in a table.

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

What is functional dependency?

A

If for any two tuples that agree on their components for {A1, …, An} they must also agreen in {B1, … Bn}

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

How can A1 … An –> B1 … Bm be rewritten?

A

A1 … An –> Bi for i = 1, …, m

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

What is a closure of a set?

A

It returns what is functionality determined determined by A under S?

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

What is the algorithm of a closure?

A
  1. If necessary split the FD’s of S, so each FD in S has a single attribute on the right
  2. Let X be a set of attributes that eventually will become the closure. Initialize X to be {A1, A2, …, An}
  3. Repeatedly search for some FD B1B2…Bm –> C
    st. all of B1, B2, …, Bm are in the set of attributes X but C is not. Add C to the set X and repeat the search. Since X can only grow, and the number of attributes of any relation schema must be finite, eventually nothing more can be added to X, and this step ends.
  4. The set X, after no more attirbutes can be added to it, is the correct value of {A1, A2, …, An }+
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are the requirements of the minimal basis?

A

A minimal basis B for S satisfies three conditions:

  1. All FDs in B have sinngleton right hand sides
  2. If any FD is removed from B, it is no longer a basis for S
  3. if for any FD we remove one or more attributes from the left hand side it is no longer a basis for S
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the relation schema of a relation?

A

It denotes the name of the table and what is in it. E.g. Movie(name, length, studio, year)

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

How to find a minimal basis?

A
  1. Make sure every relation has just one element at the RHS
  2. Ignore one FD, check if the closure of the LHS is still the same as before, if so, then it can be dropped.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly