Professional Documents
Culture Documents
Database Ch-3and4
Database Ch-3and4
Database Ch-3and4
The above table is not normalized. We will see the problems that we
face when a table is not normalized.
Conversion to 2NF
A → B:
A is a super key
5. What is ODL ? Explain with neat diagram and compare with E/R.
Unary Operators .
Selection (σ)
Projection (Π)
Rename(ρ)
Binary Operators .
Union (U )
Intersection (˄)
Difference ( – )
The binary operators listed above are also known as set operators.
Unary Operations:
OR
After the renaming the name of the relation and the attributes can be
used as ordinary relation and attributes in a sequence of relational
algebra expressions:
The product operation are maps each tuple in relation with every
tuple in S.
EmpTeams(EmpId, TeamId)
Two relations R(A1, A2, … An) and S(B1, B2, … Bn) are said to be
union compatible if
relations to be joined
EmpTeams(EmpId, TeamId)
Theta Join Operation: While the natural join enforces a join condition
by equating similar attributes in the relations to be joined; a theta join
joins relations to an arbitrary condition C.
Outer Join
Extended Projection
Duplicate Elimination
However, there are cases when we want to have all the tuples from the
participating relations and form the join when there is much. In such
cases outer join operations can be used to keep all the tuples in R, or
all those in S, or all those in both relations irrespective of they having
matching tuples in their common attributes.
Left Outer Join: Keeps every tuples in the left relation R and when
there is no matching for tuples in R from tuples in S, the attributes
of S are filled (padded) with NULL values.
It is denoted by:
It is denoted by:
It is denoted by:
Find the loan number for each loan of an amount greater or equal to
10,000.
Find the names of all customers having a loan at the “ABC” branch.
Formulas in the predicate are build in the same ways as the tuple
calculus predicates.