Open In App

RENAME (ρ) Operation in Relational Algebra

Improve
Improve
Like Article
Like
Save
Share
Report

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. 

Notation: 

ρ 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)

Last Updated : 05 Oct, 2020
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads