Tuple Level
Written Syntax: RelationA τ RelationB
Arcade Syntax: Currently Not Supported
Operation Definition
This is a unary operator that rearranges the list order of the tuples. Note that this operation does not change the underlying representation and is really for visualization purposes only. This operation requires:
- 1) L, a subset
<a1, a2, a3,…, an>of the attributes of the relation to sort the tuples by. The tuples are first sorted in ascending order according to their a1 component by using the concept of greater than (>) and lesser than operators (<). Ties within a1 are broken using a2 component values and so forth for further ties.
Usefulness:
Used typically for display and readability purposes. Since relations are sets, ordering is usually not considered.
Example:
Bam (Orginal)
D |
E |
21 |
30 |
20 |
30 |
53 |
62 |
11 |
10 |
Sort[E, D](Bar)
D |
E |
11 |
10 |
20 |
30 |
21 |
30 |
53 |
62 |