Skip to content

Commit 02deb50

Browse files
add a writeup on master-part relationships
1 parent 4ac3b5f commit 02deb50

File tree

6 files changed

+1304
-561
lines changed

6 files changed

+1304
-561
lines changed

book/30-database-design/050-relationships.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
"\n",
1717
"Referential constraints establish relationships between tables and are enforced by [foreign keys](030-foreign-keys.ipynb). They ensure that references between tables remain valid and prevent orphaned records.\n",
1818
"\n",
19+
"In DataJoint, foreign keys also participate in the **relational workflow model** introduced earlier: each dependency not only enforces referential integrity but also prescribes the order of operations in a workflow. When table `B` references table `A`, `A` must be populated before `B`, and deleting from `A` cascades through all dependent workflow steps. The resulting schema is a directed acyclic graph (DAG) whose arrows describe both data relationships and workflow execution order (see [Relational Workflows](../20-concepts/04-workflows.md)).\n",
20+
"\n",
1921
"## Foreign Keys Establish 1:N or 1:1 Relationships\n",
2022
"\n",
2123
"When a child table defines a foreign key constraint to a parent table, it creates a relationship between the entities in the parent and child tables. The cardinality of this relationship is always **1 on the parent side**: each entry in the child table must refer to a single entity in the parent table.\n",
@@ -1253,7 +1255,7 @@
12531255
"source": [
12541256
"## Sequences\n",
12551257
"\n",
1256-
"DataJoint schemas are directional: dependencies form a *directed-acyclic graph* (DAG) representing sequences of steps or operations.\n",
1258+
"As discussed in the [Relational Workflows](../20-concepts/04-workflows.md) chapter, DataJoint schemas are directional: dependencies form a *directed-acyclic graph* (DAG) representing sequences of steps or operations.\n",
12571259
"The diagrams are plotted with all the dependencies pointing in the same direction (top-to-bottom or left-to-right), so that a schema diagram can be understood as an operational workflow.\n",
12581260
"\n",
12591261
"Let's model a simple sequence of operations such as placing an order, shipping, and delivery.\n",

0 commit comments

Comments
 (0)