Relational Query Languages
Relational Algebra
The basic set of operations for the relational model is known as the
relational algebra. These operations enable a user to specify basic retrieval
requests.
There are different basic operations that could be applied on relations on a
database based on the requirement.
1. Selection ( ) Selects a subset of rows from a relation.
P_id name Age weight gender
1011093 kasim 20 59 m
1011098 digu 19 61 m
1011076 amen 17 50 M
1011081 yonas 23 70 m
1010786 dyana 19 53 f
Eg list female patients whose age is less than 20
∂<gender=”f” ˄ age < 20>(patient)
P_id name Age weight gender
1010786 dyana 19 53 f
2. Projection ( ) Deletes unwanted columns from a relation.
Eg list patient whose age is greater than 18
Π<age<18>(patient)
P_id name Age weight gender
1011093 kasim 20 59 m
1011098 digu 19 61 m
1011081 yonas 23 70 m
1010786 dyana 19 53 f