There are two types of CQL: definition CQL for defining streams and queries, and data manipulation CQL that is used in the REGISTER QUERY and REGISTER QUERY_ATTRIBUTE clauses of definition CQL.
The following table lists the definition CQL.
Table 4-1 Definition CQL list
No. | CQL | Explanation |
---|---|---|
1 | REGISTER STREAM clause | Defines a stream |
2 | REGISTER QUERY clause | Defines a query. |
3 | REGISTER QUERY_ATTRIBUTE clause | Specifies time division for a query. The query for which time division is to be used must be defined following this clause. |
The following table lists the data manipulation CQL.
Table 4-2 Data manipulation CQL list
No. | Type | Explanation |
---|---|---|
1 | Inquiry | Searches data in a relation or the stream defined in the REGISTER STREAM clause. |
2 | Stream clause | Converts data to be output into a stream. |
3 | Relation expression | Searches data in one or more relations and filters the results of the search. |
4 | SELECT clause | Specifies how the searched result (select expression) is to be output and acquires the search result as a relation. |
5 | FROM clause | Specifies one or more relations (relation references). Relations acquired by the FROM clause becomes the target of the WHERE or HAVING clauses. |
6 | WHERE clause | Specifies a search condition for a relation acquired by the FROM clause. |
7 | GROUP BY clause | Specifies the columns (grouped columns) in the relation acquired by the preceding clause. Grouping is performed on the specified grouped columns only. |
8 | HAVING clause | Specifies a search condition for a relation acquired by the FROM clause, WHERE clause, or GROUP BY clause. A search condition specified in the HAVING clause executes a logical operation, and only the true results are acquired as a relation. |
9 | UNION clause | Links together multiple SELECT clauses and executes them as a single CQL statement. |
10 | Selection list | Specifies one or more select expressions. |
11 | Select expression | Specifies the item to be output from a search result. |
12 | Aggregate functions | Calculates a value from multiple rows. |
13 | Column specification list | Specifies one or more columns. |
14 | Relation reference | Specifies the relation to be searched. Relation reference is specified using the FROM clause. |
15 | Window specification | Specifies how long stream data stays in a relation. Window specification is specified using a relation reference. |
16 | Time specification | Specifies a time unit. |
17 | Search condition | Executes a logical operation using the specified condition and acquires only true results as a new relation. A search condition is specified using the WHERE or HAVING clauses. |
18 | Comparison predicate | Specifies the condition for determining a true or false logical value. |
19 | Value expression | Specifies a value. |
20 | Constant | Specifies a constant. |