gamma function in relational algebra