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.
Query to rename the relation Employee as MaleStudent and the attributes of Employee – RollNo, EName as (Eno, Name).
ρ MaleStudent(Eno, Name) πRollNo, EName(σCondition(Student))
Eno Name 2600 Ronny 2655 Raja
Query to rename the attributes Name, Age of table Department to A,B.
ρ (A, B) (Department)
Query to rename the table name Project to Pro and its attributes to P, Q, R.
ρ Pro(P, Q, R) (Project)
Query to rename the first attribute of the table Employee with attributes A, B, C to P.
ρ (P, B, C) (Employee)
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- PROJECT Operation in Relational Algebra
- SELECT Operation in Relational Algebra
- Cartesian Product Operation in Relational Algebra
- Difference between Relational Algebra and Relational Calculus
- Set Theory Operations in Relational Algebra
- Query Optimization in Relational Algebra
- Basic Operators in Relational Algebra
- Extended Operators in Relational Algebra
- Introduction of Relational Algebra in DBMS
- How to solve Relational Algebra problems for GATE
- Difference between Tuple Relational Calculus (TRC) and Domain Relational Calculus (DRC)
- Relational Query Evaluation | Set 1
- Relational Model in DBMS
- Anomalies in Relational Model
- Relational Query Evaluation | Set 2
- Properties of Relational Decomposition
- Domain Relational Calculus in DBMS
- Tuple Relational Calculus (TRC) in DBMS
- Difference between CouchDB and Relational Database
- Difference between Relational database and NoSQL
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.