Rename

Schema-Level

Syntax:

Written Syntax: ρ<newname1, newname2,...>(Relations) Arcade Syntax: Rename[oldname/newname](Relation)

Operation Definition

This is a unary operator that renames attributes of a relation. This is important for other operators such as Natural Join, which only joins on similarly named attributes. This operation requires:

  1. 1) L, a list of new names for the attributes of relation R, given in listed display order.
  2. 2) R – a relation to sort

Usefulness:

As stated, this operator is important for other operators such as Natural Joins, which require similar named attributes. It is also useful for display and readability purposes.

Example:

Bar (Orginal)

name address
Down Under Pub 802 W. Main Street
The Edge 108 Morris Street
James Joyce Pub 912 W. Main Street
Satisfaction 905 W. Main Street
Talk of the Town 108 E. Main Street

Rename[name/barName](Bar)

barName address
Down Under Pub 802 W. Main Street
The Edge 108 Morris Street
James Joyce Pub 912 W. Main Street
Satisfaction 905 W. Main Street
Talk of the Town 108 E. Main Street