relational algebra 2 Flashcards
multiple reation define and why we need
split same infor in different sub parts
becasue our data is a set of different relation so to extract an info from it and then to study we will apply multiple relation in which we will make new tuple
cartisean product
define as it have tuple where the element belong to different tuple of relatiions
sybmole is
r1xr2
if two relation have same attribute so try to change it by renaming operator sigma
renaming operator
new_rel = sigma new_name<-old_name(old_rel)
drawback, difficulties and sol in cartsian product
difficultities are as the cartsain product are tuple of tuple and their size is sizeAXsizeB but we need such data
soltuion is that apply selection property that select thosr row with sepcific condition like same keys!
drawback is : very costly method becasue in selction we must make a copy of cartsian product.
what is natural joine , condition , syombole
it also select the tuple in cartsian product but it has condtion that it selct only those col which have same attribute in relation.
symbole is
r1 ⋈ r2 = piXY(sigmaC (r1 x r2 ))
natural joine specail cases
case1
relation have common col (attribute name) but not the value so result will be empty set
case2
if the two relation have no common name so we do not satisfy the natural joine condition thus the result will be simple cartsian product.
solution for case 2 is just rename the diffrent attribute name.