Skip to content

Commit f65bc4f

Browse files
Merge branch 'dimitri-yatsenko:main' into main
2 parents 509ebbd + a205c3f commit f65bc4f

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

book/30-design/010-schema.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"cell_type": "markdown",
55
"metadata": {},
6-
"source": "---\ntitle: Create Schemas\nauthors:\n - name: Dimitri Yatsenko\n---\n\n# What is a schema?\n\nThe term schema has two related meanings in the context of databases:\n\n## 1. Schema as a Data Blueprint\nA **schema** is a formal specification of the structure of data and the rules governing its integrity.\nIt serves as a blueprint that defines how data is organized, stored, and accessed within a database.\nThis ensures that the database reflects the rules and requirements of the underlying business or research project it supports.\n\nIn structured data models, such as the relational model, a schema provides a robust framework for defining:\n* The structure of tables (relations) and their attributes (columns).\n* Rules and constraints that ensure data consistency, accuracy, and reliability.\n* Relationships between tables, such as primary keys (unique identifiers for records) and foreign keys (references to related records in other tables).\n\n### Aims of Good Schema Design\n* **Data Integrity**: Ensures consistency and prevents anomalies.\n* **Query Efficiency**: Facilitates fast and accurate data retrieval, supports complex queries, and optimizes database performance.\n* **Scalability**: Allows the database to grow and adapt as data volumes increase.\n\n### Key Elements of Schema Design\n* **Tables and Attributes**: Each table is defined with specific attributes (columns), each assigned a data type.\n* **Primary Keys**: Uniquely identify each record in a table.\n* **Foreign Keys**: Establish relationships between entities in tables.\n* **Indexes**: Support efficient queries.\n\nThrough careful schema design, database architects create systems that are both efficient and flexible, meeting the current and future needs of an organization. The schema acts as a living document that guides the structure, operations, and integrity of the database.\n\n## 2. Schema as a Database Module\n\nIn complex database designs, the term \"schema\" is also used to describe a distinct module of a larger database with its own namespace that groups related tables together. \nThis modular approach:\n* Separates tables into logical groups for better organization.\n* Avoids naming conflicts in large databases with multiple schemas."
6+
"source": "---\ntitle: Schemas\nauthors:\n - name: Dimitri Yatsenko\n---\n\n# What is a schema?\n\nThe term schema has two related meanings in the context of databases:\n\n## 1. Schema as a Data Blueprint\nA **schema** is a formal specification of the structure of data and the rules governing its integrity.\nIt serves as a blueprint that defines how data is organized, stored, and accessed within a database.\nThis ensures that the database reflects the rules and requirements of the underlying business or research project it supports.\n\nIn structured data models, such as the relational model, a schema provides a robust framework for defining:\n* The structure of tables (relations) and their attributes (columns).\n* Rules and constraints that ensure data consistency, accuracy, and reliability.\n* Relationships between tables, such as primary keys (unique identifiers for records) and foreign keys (references to related records in other tables).\n\n### Aims of Good Schema Design\n* **Data Integrity**: Ensures consistency and prevents anomalies.\n* **Query Efficiency**: Facilitates fast and accurate data retrieval, supports complex queries, and optimizes database performance.\n* **Scalability**: Allows the database to grow and adapt as data volumes increase.\n\n### Key Elements of Schema Design\n* **Tables and Attributes**: Each table is defined with specific attributes (columns), each assigned a data type.\n* **Primary Keys**: Uniquely identify each record in a table.\n* **Foreign Keys**: Establish relationships between entities in tables.\n* **Indexes**: Support efficient queries.\n\nThrough careful schema design, database architects create systems that are both efficient and flexible, meeting the current and future needs of an organization. The schema acts as a living document that guides the structure, operations, and integrity of the database.\n\n## 2. Schema as a Database Module\n\nIn complex database designs, the term \"schema\" is also used to describe a distinct module of a larger database with its own namespace that groups related tables together. \nThis modular approach:\n* Separates tables into logical groups for better organization.\n* Avoids naming conflicts in large databases with multiple schemas."
77
},
88
{
99
"cell_type": "markdown",

book/30-design/015-table.ipynb

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,7 @@
88
{
99
"cell_type": "markdown",
1010
"metadata": {},
11-
"source": [
12-
"# Prerequisites: Schema Declaration\n",
13-
"\n",
14-
"Before creating tables, we must declare a schema object that provides a namespace for our tables (see [Create Schemas](010-schema.ipynb)):"
15-
]
11+
"source": "# Prerequisites: Schema Declaration\n\nBefore creating tables, we must declare a schema object that provides a namespace for our tables (see [Schemas](010-schema.ipynb)):"
1612
},
1713
{
1814
"cell_type": "code",
@@ -328,19 +324,7 @@
328324
{
329325
"cell_type": "markdown",
330326
"metadata": {},
331-
"source": [
332-
"```{warning}\n",
333-
"**This action is irreversible!**\n",
334-
"\n",
335-
"- Removes table structure and all data\n",
336-
"- Cascades to dependent tables if they exist\n",
337-
"- Requires kernel restart after dropping\n",
338-
"\n",
339-
"Always back up critical data before dropping tables.\n",
340-
"```\n",
341-
"\n",
342-
"For information on dropping entire schemas, see [Create Schemas](010-schema.ipynb)."
343-
]
327+
"source": "```{warning}\n**This action is irreversible!**\n\n- Removes table structure and all data\n- Cascades to dependent tables if they exist\n- Requires kernel restart after dropping\n\nAlways back up critical data before dropping tables.\n```\n\nFor information on dropping entire schemas, see [Schemas](010-schema.ipynb)."
344328
},
345329
{
346330
"cell_type": "code",

book/30-design/090-pipeline-project.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ A production DataJoint pipeline project:
314314
For simple scripts and learning, see the examples throughout this book. Use this full project structure when you're ready for production deployment.
315315

316316
:::{seealso}
317-
- [Create Schemas](010-schema.ipynb) — Declaring schemas and tables
317+
- [Schemas](010-schema.ipynb) — Declaring schemas and tables
318318
- [Orchestration](../40-operations/060-orchestration.ipynb) — Running pipelines at scale
319319
- [DataJoint Specs](../95-reference/SPECS_2_0.md) — Complete specification reference
320320
:::

0 commit comments

Comments
 (0)