Project

Tuple Level | Schema Level

Syntax:

Written Syntax: π<attr1, attr2>(Relation) Arcade Syntax: Project[attr1, attr2](Relation)

Operation Definition

This is a unary operation that reduces the attributes of a relation down to a subset of those attributes. This operation requires:

  1. 1) L, a subset {a1, a2, a3,…, an} of the attributes of the relation to keep. The included attributes are kept in the resulting relations schema. All of the tuples lose their component values for the attributes not included in L.
  2. 4) R – a relation to project.

Usefulness:

This is often used to select specific attributes we are most interested in; to narrow down the table. It is also useful to avoid naming conflicts between relations that you would like to join.

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

Project[name](Bar)

name
Down Under Pub
The Edge
James Joyce Pub
Satisfaction
Talk of the Town