Explain select, project and division operations with examples. (RGPV 2019)
Ans. Select operations : Select operation displays the records for the condition. Select operation is denoted by sigma (σ).
Syntax:
σcondition(TableName)
Example:
RollNo |
Name |
Brach |
012 |
Jayesh |
CSE |
013 |
Kunal |
ME |
015 |
Dipali |
EC |
Input:
σName=Jayesh(Student)
Output:
RollNo |
Name |
Brach |
012 |
Jayesh |
CSE |
Project operation : Project operations displays the specific column of a table. Projection operation is denoted by pie (∏).
Syntax:
∏ColumnName (TableName)
Example:
RollNo |
Name |
Brach |
012 |
Jayesh |
CSE |
013 |
Kunal |
ME |
015 |
Dipali |
EC |
Input:
∏RollNo (Student)
Output:
RollNo |
012 |
013 |
015 |
Division operations :
Division operations involves dividing one relation by another. The division operator is used for division operations.
Student |
|
RollNo |
Brach |
012 |
CSE |
013 |
ME |
015 |
EC |
019 |
CSE |
021 |
CE |
034 |
AI |
Branch |
Brach |
CSE |
ME |
EC |
Student / Branch |
RollNo |
012 |
019 |
In above example, when the division operation is performed, it will retrieve only those RollNo from relation “Student” who has branch “CSE” from relation Branch.