Misplaced Pages

Rename (relational algebra)

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

In relational algebra, a rename is a unary operation written as ρ a / b ( R ) {\displaystyle \rho _{a/b}(R)} where:

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

Employee {\displaystyle {\text{Employee}}} ρ EmployeeName/Name ( Employee ) {\displaystyle \rho _{\text{EmployeeName/Name}}({\text{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 ] : t R   } , {\displaystyle \rho _{a/b}(R)=\{\ t:t\in R\ \},}

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

t [ a / b ] = {   ( c , v )   |   ( c , v ) t ,   c b   } {   ( a ,   t ( b ) )   } . {\displaystyle t=\{\ (c,v)\ |\ (c,v)\in t,\ c\neq b\ \}\cup \{\ (a,\ t(b))\ \}.}

References

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