DBMS Relational Algebra Flashcards

1
Q

Whats Relational Algebra

A

Relational algebra is a procedural query language. It gives a step by step process to obtain the result of the query. It uses operators to perform queries.

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

What are Binary and Unary Operators?

A

Unary:
Selection
Projection
Rename

Binary:
Joins
Cross-product
Set operators
Division

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

What are Binary and Unary Operators?

A

Unary:
Selection
Projection
Rename

Binary:
Joins
Cross-product
Set operators
Division

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

Explain Projection Operator

A

Selects specified attributes of a relation.
* It removes duplicate tuples (records) from the result.

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

Explain Projection Operator

A

Selects specified attributes of a relation.
* It removes duplicate tuples (records) from the result.

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

Explain Selection Operator

A

Selects tuples from a relation that satisfy a given
condition.

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

Explain Selection Operator

A

Selects tuples from a relation that satisfy a given
condition.

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

What comes first in the mixture of selection and proejection operators!? f

A

first write the projection opertor and then in bracket write the selection operator

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

Write abt the operation of Cartesian or Cross Product

A

It will multiply each tuples of Relation-1 to each tuples of Relation-2.
* Attributes of Resultant Relation = Attributes of R1 + Attributes of R2
* Tuples of Resultant Relation = Tuples of R1 * Tuples of R2

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

Write abt the operation of Natural/Inner Join?

A

Natural join will retrieve consistent data from multiple relations.
* It combines records from different relations that satisfy a given condition.

To perform a Natural Join there must be one common attribute (column) between two relations.

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

Steps for performing Natural/Inner Join are?

A

Step – 1 It performs Cartesian Product
Step – 2 Then it deletes inconsistent tuples
Step – 3 Then it removes an attribute from duplicate attributes

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

Whats Outer join?

A

Outer Join
* In natural join some records are missing, if we want that missing records than we have to use outer join.
To perform a Outer Join there must be one common attribute (column) between two relations.

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

Operation of Left Outer Join?

A

Operation:
* Display all the tuples of the left relation even through there is no matching tuple in the right relation.
* For such kind of tuples having no matching, the attributes of right relation will be padded with NULL in resultant relation.

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

Operation of Right Outer Join

A

Operation:
* Display all the tuples of right relation even through there is no matching tuple in the left relation.
* For such kind of tuples having no matching, the attributes of left relation will be padded with NULL in resultant relation.

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

Operation of Full Outer Join

A

Operation:
* Display all the tuples of both of the relations. It also pads null values whenever required. (Left outer join + Right outer join)
* For such kind of tuples having no matching, it will be padded with NULL in resultant relation.

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

Operation of Union Operator

A

Operation:
* It displays all the tuples/records belonging to the first relation (left relation) or the second relation (right
relation) or both.
* It also eliminates duplicate tuples (tuples present in both relations appear once).

15
Q

Operation of Intersect/ Intersection Operator

A

Operation:
* It displays all the tuples/records belonging to both relations. OR
* It displays all the tuples/records which are common from both relations.

16
Q

Operation of Minus/ Set difference Operator

A

Operation:
* It displays all the tuples/records belonging to the first relation (left relation) but not in the second relation
(right relation).

17
Q

What are the types of Functional Dependencies

A

Trivial FD:RHS is subset of LHS
Nontrivial FD: One of RHS attribute is not subset LHS.
Completely Non-Trivial FD: None of RHS attribute is subset of LHS.
Full Functional Dependency: In a relation, the attribute B is fully functional dependent on A if B is functionally dependent on A, but not on any proper subset of A.

18
Q

Partial Functional Dependency:

A

Partial Functional Dependency
In a relation, the attribute B is partial functional dependent on A if B is functionally dependent on
A as well as on any proper subset of A.

19
Q

Transitive Functional Dependency:

A

Transitive Functional Dependency
In a relation, if attribute(s) A →B and B →C, then A →C (means C is transitively depends on A via B).

20
Q

What are armstrong’s axioms

A

Armstrong’s axioms are a set of rules used to infer (derive) all the functional dependencies on a relational database.

20
Q

What are armstrong’s axioms

A

Armstrong’s axioms are a set of rules used to infer (derive) all the functional dependencies on a relational database.

20
Q

What are armstrong’s axioms

A

Armstrong’s axioms are a set of rules used to infer (derive) all the functional dependencies on a relational database.

21
Q

Whats a closure

A

Given a set of attributes α, the closure of α under F is the set of attributes that are functionally determined by α under F.

22
Q

Use of the closure is:

A

Use of Closure of Attributes:
* To identify the additional FDs.
* To identify the keys
* To identify the equivalence of FD
* To identify the standard form, canonical form or irreducible set of FD.

23
Q

What is Decomposition?

A

Decomposition is the process of breaking down given relation into two or
more relations.

24
Q

Types of Decomposition?

A

Types of decomposition
* Lossy decomposition
* Lossless decomposition (non-loss decomposition)

25
Q

Properties of Decomposition?

A

Properties of Decomposition:
* Lossless (Mandatory)
* Dependency Preserving (Optional)

26
Q

What is Lossy Decomposition?

A

Lossy decomposition
* The decomposition of relation R into R1 and R2
is lossy when the natural join of R1 and R2 does
not yield the same relation as in R.
* This is also referred as lossy-join decomposition.