@@ -197,7 +197,7 @@ TutorialD (master/main): :showexpr s{all but city}
197└────────┴───────────┴───────────────┘
197└────────┴───────────┴───────────────┘
200−Projection attributes can also be derived from a relational expression using `all from`:
200+Projection attributes can be derived from a relational expression using `all from`:
203TutorialD (master/main): :showexpr (s join sp){all from s}
203TutorialD (master/main): :showexpr (s join sp){all from s}
@@ -213,6 +213,42 @@ TutorialD (master/main): :showexpr (s join sp){all from s}
214Above, we join `s` and `sp` but project the result back onto the attributes of `s`.
214Above, we join `s` and `sp` but project the result back onto the attributes of `s`.
216+Projection attributes can be unioned from multiple sources using `union of`:
219+TutorialD (master/main): :showexpr (s join sp){union of {all from s} {all but p#}}
220+┌──────────┬────────────┬────────┬───────────┬───────────────┐
221+│city::Text│qty::Integer│s#::Text│sname::Text│status::Integer│
222+├──────────┼────────────┼────────┼───────────┼───────────────┤
223+│"Paris" │400 │"S2" │"Jones" │10 │
224+│"London" │400 │"S1" │"Smith" │20 │
225+│"Paris" │200 │"S3" │"Blake" │30 │
226+│"London" │200 │"S4" │"Clark" │20 │
227+│"London" │200 │"S1" │"Smith" │20 │
228+│"Paris" │300 │"S2" │"Jones" │10 │
229+│"London" │100 │"S1" │"Smith" │20 │
230+│"London" │300 │"S4" │"Clark" │20 │
231+│"London" │300 │"S1" │"Smith" │20 │
232+│"London" │400 │"S4" │"Clark" │20 │
233+└──────────┴────────────┴────────┴───────────┴───────────────┘
236+Here, after joining `s` and `p`, the union of all attributes from `s` and all attributes from `p` except for `p#` are returned.all
238+Finally, projection attributes can be intersected using `intersection of`:
241+TutorialD (master/main): :showexpr (s join sp){intersection of {all from s} {all from p}}
250+Here, after joining `s` and `p`, we project on the intersection of attributes from `s` and `p` which happens to be `city`.
216#### Restriction
252#### Restriction
218Restriction is applied using a "where" clause, much like in SQL.
254Restriction is applied using a "where" clause, much like in SQL.