2
2
3
3
[ Data queries] ( ../query-objs ) make use of operators to derive the desired table. They
4
4
represent the desired data symbolically, but do not contain any data. Once a query is
5
- formed, we can [ fetch] ( .. /common-commands#fetch ) the data into the local workspace. Since
5
+ formed, we can [ fetch] ( ./common-commands#fetch ) the data into the local workspace. Since
6
6
the expressions are only symbolic, repeated ` fetch ` calls may yield different results as
7
7
the state of the database is modified.
8
8
@@ -50,7 +50,7 @@ In order for these operators to be applied to tables, they must also be
50
50
<span id =" join-compatible " >** join-compatible** </span >, which means that:
51
51
52
52
1 . All fields in both tables must be part of either the
53
- [ primary key] ( ../../../ glossary#primary-key ) or a [ foreign key] ( ../../.. /glossary#foreign-key ) .
53
+ [ primary key] ( ../concepts/ glossary#primary-key ) or a [ foreign key] ( ../concepts /glossary#foreign-key ) .
54
54
55
55
2 . All common fields must be of a compatible datatype for equality comparisons.
56
56
@@ -65,23 +65,23 @@ In order for these operators to be applied to tables, they must also be
65
65
66
66
The Join operator ` A * B ` combines the matching information in ` A ` and ` B ` . The result
67
67
contains all matching combinations of entities from both arguments, including all
68
- unique [ primary keys] ( ../../.. /glossary#primary-key ) from both arguments.
68
+ unique [ primary keys] ( ../concepts /glossary#primary-key ) from both arguments.
69
69
70
70
In the example below, we look at the union of (A) a table pairing sessions with users
71
71
and (B) a table pairing sessions with scan.
72
72
73
73
<figure markdown >
74
- ![ Join example] ( ../../../ images/concepts-operators-join1.png ) {: style="height:200px"}
74
+ ![ Join example] ( ../images/concepts-operators-join1.png ) {: style="height:200px"}
75
75
</figure >
76
76
77
77
This has all the primary keys of both tables (a union thereof, shown in bold) as well as
78
- all [ secondary attributes] ( ../../.. /glossary#seconday-attribute ) (i.e., user and
78
+ all [ secondary attributes] ( ../concepts /glossary#seconday-attribute ) (i.e., user and
79
79
duration). This also excludes the session for which we don't have a scan.
80
80
81
81
We can also join based on secondary attributes, as shown in the example below.
82
82
83
83
<figure markdown >
84
- ![ Join example] ( ../../../ images/concepts-operators-join2.png ) {: style="height:200px"}
84
+ ![ Join example] ( ../images/concepts-operators-join2.png ) {: style="height:200px"}
85
85
</figure >
86
86
87
87
??? notes "Additional join properties"
@@ -131,7 +131,7 @@ The `proj` operator represents **projection** and is used to select attributes
131
131
(columns) from a table, to rename them, or to create new calculated attributes.
132
132
133
133
1 . A simple projection * selects a subset of attributes* of the original
134
- table, which may not include the [ primary key] ( ../../.. /glossary#primary-key ) .
134
+ table, which may not include the [ primary key] ( ../concepts /glossary#primary-key ) .
135
135
136
136
2 . A more complex projection * renames an attribute* in another table. This could be
137
137
useful when one table should be referenced multiple times in another. A user table,
@@ -156,8 +156,8 @@ and others.
156
156
157
157
The result of the union operator ` A + B ` contains all the entities from both operands.
158
158
159
- [ Entity normalization] ( ../normalization ) requires that ` A ` and ` B ` are of the same type,
160
- with with the same [ primary key] ( ../../.. /glossary#primary-key ) , using homologous
159
+ [ Entity normalization] ( ../design/ normalization ) requires that ` A ` and ` B ` are of the same type,
160
+ with with the same [ primary key] ( ../concepts /glossary#primary-key ) , using homologous
161
161
attributes. Without secondary attributes, the result is the simple set union. With
162
162
secondary attributes, they must have the same names and datatypes. The two operands
163
163
must also be ** disjoint** , without any duplicate primary key values across both inputs.
@@ -214,7 +214,7 @@ Universal sets should be used sparingly when no suitable base tables already exi
214
214
some cases, defining a new base table can make queries clearer and more semantically
215
215
constrained.
216
216
217
- The examples below will use the table definitions in [ table tiers] ( ../../ reproduce/table-tiers ) .
217
+ The examples below will use the table definitions in [ table tiers] ( ../reproduce/table-tiers ) .
218
218
219
219
<!-- ## Join appears here in the general docs -->
220
220
@@ -224,7 +224,7 @@ The examples below will use the table definitions in [table tiers](../../reprodu
224
224
225
225
### By a mapping
226
226
227
- For a [ Session table] ( ../../ reproduce/table-tiers#manual-tables ) , that has the attribute
227
+ For a [ Session table] ( ../reproduce/table-tiers#manual-tables ) , that has the attribute
228
228
` session_date ` , we can restrict to sessions from January 1st, 2022:
229
229
230
230
``` python
0 commit comments