Related Articles

Related Articles

RENAME (ρ) Operation in Relational Algebra
  • Last Updated : 05 Oct, 2020

Prerequisites – Introduction of Relational Algebra in DBMS, Basic Operators in Relational Algebra 

The RENAME operation is used to rename the output of a relation. 

Sometimes it is simple and suitable to break a complicated sequence of operations and rename it as a relation with different names. Reasons to rename a relation can be many, like –  

  • We may want to save the result of a relational algebra expression as a relation so that we can use it later. 
  • We may want to join a relation with itself, in that case, it becomes too confusing to specify which one of the tables we are talking about, in that case, we rename one of the tables and perform join operations on them. 


ρ X (R)

where the symbol ‘ρ’ is used to denote the RENAME operator and R is the result of the sequence of operation or expression which is saved with the name X.  

  • Example-1:  Query to rename the relation Student as Male Student and the attributes of Student – RollNo, SName as (Sno, Name).
Sno Name
2600 Ronny
2655 Raja
ρ MaleStudent(Sno, Name) πRollNo, SNameCondition(Student))
  • Example-2:  Query to rename the attributes Name, Age of table Department to A,B. 
ρ (A, B) (Department)
  • Example-3: Query to rename the table name Project to Pro and its attributes to P, Q, R. 
ρ Pro(P, Q, R) (Project)
  • Example-4: Query to rename the first attribute of the table Student with attributes A, B, C to P. 
ρ (P, B, C) (Student)

Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.

My Personal Notes arrow_drop_up
Recommended Articles
Page :