Reg algebra girija-projection

15
R1 := π L (R2) L is a list of attributes from the schema of R2. R1 is constructed by looking at each tuple of R2, extracting the attributes on list L, in the order specified, and creating from those components a tuple for R1. Eliminate duplicate tuples, if any. PROJECTION

Transcript of Reg algebra girija-projection

Page 1: Reg algebra girija-projection

R1 := πL (R2)

L is a list of attributes from the schema of R2.

R1 is constructed by looking at each tuple of R2, extracting the attributes on list L, in the order specified, and creating from those components a tuple for R1.

Eliminate duplicate tuples, if any.

PROJECTION

Page 2: Reg algebra girija-projection

2

Example: Projection

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,price(Sells):

milk price Al-marai 2.50 Al-marai 2.75 Lancor 2.50 Lancor 3.00

Sells

Page 3: Reg algebra girija-projection

Display the name column only Display name column whose salary is greater than 80000

Projection – exercise 1

Page 4: Reg algebra girija-projection

Projection – exercise 1 solution

Page 5: Reg algebra girija-projection

PROJECTION-exercise 2 solution

Page 6: Reg algebra girija-projection

PROJECTION-exercise 3

Display Surname,Firstname Display Department,head

Page 7: Reg algebra girija-projection

PROJECTION-exercise 3 solution

Page 8: Reg algebra girija-projection

PROJECTION-exercise 4

Display all the Acc-no, title of the book

Page 9: Reg algebra girija-projection

PROJECTION-exercise 4 Solution

Page 10: Reg algebra girija-projection

PROJECTION-exercise 5

Display name, dept of the EMP

Page 11: Reg algebra girija-projection

PROJECTION-exercise 5 Solution

Page 12: Reg algebra girija-projection

Display age, weight from person

PROJECTION-exercise 6

Page 13: Reg algebra girija-projection

PROJECTION-exercise 6 solution

Page 14: Reg algebra girija-projection
Page 15: Reg algebra girija-projection