Rename (relational algebra)

From The Right Wiki
Jump to navigationJump to search

In relational algebra, a rename is a unary operation written as ρa/b(R) where:

The result is identical to R except that the b attribute in all tuples is renamed to a.[1] For an example, consider the following invocation of ρ on an Employee relation and the result of that invocation:

Employee ρEmployeeName/Name(Employee)
Name EmployeeId
Harry 3415
Sally 2241
EmployeeName EmployeeId
Harry 3415
Sally 2241

Formally, the semantics of the rename operator is defined as follows:

ρa/b(R)={t[a/b]:tR},

where t[a/b] is defined as the tuple t, with the b attribute renamed to a, so that:

t[a/b]={(c,v)|(c,v)t,cb}{(a,t(b))}.

References

  1. Introduction to Database Systems. Pearson Education India. 2010. pp. 103–105. ISBN 978-81-317-3192-5.