A relational operation extracts results using the following three types of operations:
- Select
Extracts the tuples that satisfy the specified condition from an input relation containing n-tuples.
An example follows:
REGISTER QUERY q1 SELECT s1.a FROM s1 [ROWS 10] WHERE s1.a > 10; |
In this example, the tuples that satisfy the condition specified beginning with the WHERE clause are extracted from the input relation s1.
- Link
Extracts from multiple input relations containing n-tuples the results in which data items are combined where a specified condition is satisfied.
An example follows:
REGISTER QUERY q2 SELECT s1.a, s1.b, s2.b FROM s1 [ROWS 10], s2 [ROWS 10] WHERE s1.a = s2.a; |
In this example, the tuples that satisfy the condition specified beginning with the WHERE clause are extracted from the input relations s1 and s2.
- Aggregate function
Extracts the result obtained from executing an aggregate function on an input relation that contains n-tuples.
An example follows:
REGISTER QUERY q3 SELECT SUM(s1.a) AS c1 FROM s1 [ROWS 10]; |
In this example, the result obtained from executing the aggregate function SUM on the input relation s1 is extracted.
For details about processing a relation operation, see 4. CQL Reference.
Of the processes performed in relation operations, linking and computational operations involving aggregate functions are described as examples below.