rel algebra selection girija
DESCRIPTION
set theory, selection, relational algebra, database - all the exercise sildes i have downloaded or referred from websites. i just orgainsed as topicwise for readers, www.youtube.com - video is available (search as "dr.girija narasimhan")TRANSCRIPT
![Page 1: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/1.jpg)
R1 := σC (R2)
C is a condition (as in “if” statements) that refers to attributes of R2.
R1 is all those tuples of R2 that satisfy C.
selection
milk milk_type price Al-marai Full_Fat 2.50 Al-marai Refresh 2.75 Lancor Full_Fat 2.50 Lancor Refresh 3.00
Prices := σ milk=‘Al-marai’(Sells):
milk milk_type Al-marai Full_Fat Al-marai Refresh
Sells
price 2.50 2.75
Display only the milk Al-marai
1 DR.GIRIJA NARASIMHAN
![Page 2: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/2.jpg)
2 DR.GIRIJA NARASIMHAN
![Page 3: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/3.jpg)
For example, the operation SID=101 selects all tuples in the input relation which have the value 101 in column SID.
Exercise 1- selection Exercise 2- selection
Select only A which has value one
3 DR.GIRIJA NARASIMHAN
![Page 4: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/4.jpg)
For example, the operation SID=101 selects all tuples in the input relation which have the value 101 in column SID.
Selection – exercise 1 & 2 Result
4 DR.GIRIJA NARASIMHAN
![Page 5: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/5.jpg)
Selection – exercise 3
Select the employee whose age is less than 30 or salary is greater than 4000
5 DR.GIRIJA NARASIMHAN
![Page 6: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/6.jpg)
Selection – exercise 3 solution
6 DR.GIRIJA NARASIMHAN
![Page 7: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/7.jpg)
Selection – exercise 4
Select where placeofbirth and residence place have same value or same place.
7 DR.GIRIJA NARASIMHAN
![Page 8: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/8.jpg)
Selection – exercise 4 solution
8 DR.GIRIJA NARASIMHAN
![Page 9: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/9.jpg)
Selection – exercise 5
Select where person whose age is greater than or equal to 34
Select the person whose age and weight should be same
9 DR.GIRIJA NARASIMHAN
![Page 10: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/10.jpg)
Selection – exercise 5 solution
10 DR.GIRIJA NARASIMHAN
![Page 11: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/11.jpg)
Selection – exercise 6
11 DR.GIRIJA NARASIMHAN
![Page 12: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/12.jpg)
Selection – exercise 6 solution
12 DR.GIRIJA NARASIMHAN
![Page 13: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/13.jpg)
Selection – exercise 7
13 DR.GIRIJA NARASIMHAN
![Page 14: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/14.jpg)
Selection – exercise 8
14 DR.GIRIJA NARASIMHAN
![Page 15: Rel algebra selection girija](https://reader033.vdocuments.site/reader033/viewer/2022060116/55839162d8b42af07a8b4b5b/html5/thumbnails/15.jpg)
Selection – exercise 8 solution
15 DR.GIRIJA NARASIMHAN