relational algebra1 Flashcards
what is relational algebra and why we use it
relational algebra can be defind as a notion for specfing quiries about the content of relation.
we use it becasue it ease the task
it has counter part in sql
the DBMS change our qury to notion simliear to RA.
relational algebra is a ————- language
procedurale languge i.e it tells about all the exact procedure of data in which it order it is performed.
define set algebra
set algebra: operands are sets and operators are U, ∩, −
what are oprand in relational algebra
operands are set of tuples
the output is also set of tuple
four opration in relational algebra are ?
1)cutting property i.e projection and selection
2)formal set opertion
3)joining two data set
4)renaming of attribute
projection?
vertical cut
selct subset by col
symbole is PIA1,A2,…,Ak(R)
here PI show projection a1…ak shows the attribut or col in schema R
important piont about projection
it is that if we are applying any operstion and we ancunter duplicate item so it will print once becasue the output is set of tuples and set can not have same elements.
key?
key are the importnt part of DBMS which we will be using in all opration they are define as unique element in DBMS .
what is selection, symbole,condition
it is horzintal cut apply on row
symbole is sigma
return those tuple in a row which fulfill condtion
condition are of booliean and comparsion
for seltion two attribute must have sme domain
which is good selction or projection
selction is good because it will not loose tuple
union
possible only on union comptable
union comptable
same domain
same number of attribute i.e data in short
note if a shema is not union compatable you can make it compatable by projection or selction
difference
can be done onljy on union comptable
defind as all the relation that are in R1 but not in R2.
symbole is
R1-R2
differnce is commutaitve or not
no
intersection
union compatble only
symbole is
r1 ∩ r2= (r1 - (r1 - r2 ))