Week 4 Flashcards

1
Q

What is the Relational algebra

A

A mathematical query language that forms the basis of the SQL query language

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

What is the Selection operation do?

A

Selects a subset of rows from relation.

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

What is the Projection operation do?

A

Deletes unwanted columns from relation.

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

What is the Cross-product operation do

A

Combines two relations.

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

What is Set-difference operation do?

A

Tuples in relation 1, but not in relation 2.

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

What is the Union operation do?

A

Tuples in relation 1 and relation 2

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

What will the Schema of the result contain after the projection?

A

Projection operator eliminate duplicates.

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

What will the Schema of the result contain after the selection?

A

The selection operator, selects rows that satisfy selection condition

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

What will the Schema of result be after the relational algebra operation?

A

Result relation can be the input for another relational algebra operation

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

Union Example

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

Intersection Example

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

Set difference example

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

Cross Product example

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

Both S1 and R1 have a field called sid, Which may cause a conflict when referring to columns

A

Rename an operator by taking a relation schema and gives a new name to the schema and the columns

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

What would this Condition join statement equivalent to

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

What is an Equi-Join

A

A special case of condition join where the condition c contains only equalities

17
Q

What would the statement A / B means where A have 2 fields, x and y; B has only the field y.

A

A/B contains all x values (players) such that for every y value (game) in B, there is an x-y paired value in A

18
Q

Find names of sailors who’ve reserved boat #103

A
19
Q

Find names of sailors who’ve reserved a red boat

A
20
Q

What is the 4 conceptual evaluation strategies?

A
  1. Comput the cross-product of relation-list.
  2. Discard resulting tuples if they do not satisfy the conditions.
  3. Display attributes that are in attribute-list.
  4. If DISTINCT is specified, eliminate duplicate rows.
21
Q

Why do we do decomposition?

A

Are done to remove redundant data that can lead to anomalies

22
Q

What is the 1st normal form says?

A

specifies that all tables in a relational database must be structured so that each column contains atomic values. In other words, each column of a table must hold only a single, indivisible value.

23
Q

What is the 2nd normal form says?

A

Specifies that a table must be in 1NF and should not have any partial dependencies. In other words, each non-key column in a table should be dependent on the entire primary key, not just part of it.

24
Q

What is the 3rd normal form says?

A

Specifies that a table must be in 2NF and no non-prime attribute determines a non-prime attribute (only keys can determine!).