1.(8 + 14) / 2 - 4
In this example, the arithmetic expression evaluates as 7.
2.DEFINE FIELD NAME
COMPUTED BY FIRST_NAME | ' ' | MIDDLE_INITIAL | ' ' | LAST_NAME.
The output is:
JOHN Q PUBLIC
In this example, the concatenated expression combines three
fields into the NAME field definition. The space between each
pair of quotation marks appears in the output of the NAME
field.
3.COUNT OF E IN EMPLOYEES WITH
LAST_NAME IN FULL_NAME IN E = "SMITH".
In this example, the FIELD or RECORD expression specifies
the LAST_NAME field in the FULL_NAME record in the EMPLOYEES
relation.
4.FIRST SALARY IN E FROM E IN EMPLOYEES
WITH LOCATION IN E = "BUILDING_A"
In this example, the FIRST FROM expression finds the salary of
the first employee who works in BUILDING_A.
5.AVERAGE SALARY_AMOUNT IN CS OF CS IN SALARY WITH SALARY_AMOUNT IN CS GT
50000
In this example, the AVERAGE statistical expression uses the
RSE to form a stream of records where the SALARY_AMOUNT field
is greater than 50,000. The average of the values is calculated
by the product reading the expression.
6.MAX SALARY_AMOUNT IN CS OF SAL IN CURRENT_SALARY WITH SALARY IN SAL = MAX
This example shows how to use the MAX expression to find the
highest paid employee in the company.
7.MIN SALARY_AMOUNT IN CS OF SAL IN CURRENT_SALARY WITH SALARY IN SAL = MIN
In this example, the MIN expression finds the lowest paid
employee in the company.
8.TOTAL SALARY_AMOUNT IN CS OF CS IN CURRENT_SALARY
The TOTAL expression finds the total annual payroll of the
company.
9.8 + 7
This example shows an arithmetic expression that adds two
numeric literals.
108 + 14 / 2 - 4
This is an example of an arithmetic expression that is
evaluated as 11.
118 + 14 / (2 - 4)
In this example, the arithmetic expression is evaluated as 1.