-
Notifications
You must be signed in to change notification settings - Fork 0
Join
Given two tables t1 and t2 with zero or more attributes in common (same name, same type), the join operation yields a table where each row in t1 is matched with every compatible row in t2. For now, let’s ignore the case where there are no attributes in common. A row is compatible if values match for all of the attributes shared by the two tables.
You can imagine the join symbol ## as depicting two tables joined together.

t #= Air Traffic Controller ## On Duty Controller
As a result of the join, t will be assigned a table with columns ID, Name, Rating, Time logged in and Station. Since the attribute ID has the same name and type in each class, each row represents all the common and specific data for an on duty air traffic controller.
If we only wanted a table of log in times organized by ID later than some specific time, we could do this:
late times #= (Air Traffic Controller ## On Duty Controller( Time logged in > some time )).(ID, Time logged in)
By surrounding the join result in parenthesis we can add a projection expression after a dot just as we would with any table.
If you join two tables with no attributes in common, each row in the first table will be compatible with every row in the second table. Consequently, you end up with the cartesian product.
Let’s say we have a class called Assembly Station with attributes ID and Location and another class called Manufacturing Task with attributes Name and Duration.
max assignments = ?(Assembly Station ## Manufacturing Task) // Total possible task-station assignments
Since there are no attributes in common, we end up with a table having attributes ID, Location, Name and Duration where each instance of Assembly Station is matched with every instance of Manufacturing Task to yield a table of all combinations and then we take the cardinality of that resulting table to get max assignments. Note that the cartesian product table was an intermediate result that was not assigned to any table variable.
Copyright 2020, 2021, 2022, 2023, 2025 © Leon Starr under MIT Open Source License
- Why they are problematic
- Instance attribute creation values
- Boolean values
- Special values
- Enumerated values
- Action block
- Statement
- Single line action
- Multiple dependent actions on a single line
- An action spread across multiple lines
- A conditional group of single line actions
- Comments
- Finding instances
- Attribute access
- Creation and deletion
- Subclass migration
- Creating a table from a class
- Creating a table with a definition
- Converting a table into a class
- Set operations on tables
- Set comparisons on tables
- Join
- Rename
- Extend
- Aggregation
- Rank
- Image
- Input values
- Signatures and name doubling
- Output values
- Execution order
- Sequential execution
- Conditional execution
- Signals
- Scrall has no for_each action
- Iteration