Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 1 addition & 99 deletions book/80-examples/000-example-designs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,105 +8,7 @@
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Overview of Examples\n",
"\n",
"This section presents a variety of schema examples that demonstrate different aspects of DataJoint design principles. Each example showcases specific patterns, relationships, and use cases ranging from classic database tutorials to real-world scientific applications.\n",
"\n",
"### Classic Database Examples\n",
"\n",
"These examples are adapted from well-known database tutorials to show how traditional relational designs map to DataJoint's entity-workflow model.\n",
"\n",
"#### [Classic Sales Database](010-classic-sales.ipynb)\n",
"The classic MySQL tutorial sales database featuring customers, orders, products, and employees. This example demonstrates:\n",
"- Traditional business database design\n",
"- Many-to-many relationships through order details\n",
"- Employee management hierarchies\n",
"- Product lines and order fulfillment\n",
"\n",
"#### [University Database](015-university.ipynb)\n",
"A university course enrollment system with students, courses, instructors, and enrollments. This example illustrates:\n",
"- Academic record keeping\n",
"- Course registration workflows\n",
"- Student-course many-to-many relationships\n",
"- Grade tracking and prerequisites\n",
"\n",
"#### [Nations Database](030-nations.ipynb)\n",
"A geographical database with countries, regions, and continents from the MariaDB tutorial. This example shows:\n",
"- Hierarchical geographical relationships\n",
"- Lookup tables for standardized data\n",
"- Regional groupings and classifications\n",
"\n",
"### Conceptual Examples\n",
"\n",
"These examples focus on specific design patterns and conceptual challenges in database modeling.\n",
"\n",
"#### [Hotel Reservation System](040-hotel.ipynb)\n",
"A complete hotel management system with rooms, reservations, check-ins, and check-outs. This design exercise demonstrates:\n",
"- Time-series data (room availability and pricing)\n",
"- Business rule enforcement (no double-booking, check-in requires reservation)\n",
"- Guest management and payment processing\n",
"- Temporal queries (who stayed when, room history)\n",
"\n",
"#### [Social Generations](044-generations.ipynb)\n",
"Defines social generations as birth cohorts sharing cultural and historical experiences. This example explores:\n",
"- Lookup tables for reference data\n",
"- Birth year ranges and generational characteristics\n",
"- Cultural archetypes and life principles\n",
"- Using DataJoint to model sociological concepts\n",
"\n",
"#### [Languages and Proficiency](050-languages.ipynb)\n",
"A many-to-many relationship design tracking people and their language skills using international standards. This comprehensive example demonstrates:\n",
"- **ISO 639-1 language codes**: Standardized two-letter codes for major world languages\n",
"- **CEFR proficiency levels**: Common European Framework of Reference for Languages (A1-C2)\n",
"- **Association tables**: `Proficiency` as a workflow step linking people, languages, and levels\n",
"- **Lookup tables**: Both `Language` and `CEFRLevel` with predefined, standardized content\n",
"- **International standards**: Using established frameworks ensures consistency and compatibility\n",
"- **Sample queries**: Finding multilingual individuals, proficient speakers, and language statistics\n",
"\n",
"### Organizational Examples\n",
"\n",
"These examples model organizational structures and hierarchies.\n",
"\n",
"#### [Management Hierarchy](060-management.ipynb)\n",
"Demonstrates self-referencing tables and organizational relationships. This example shows:\n",
"- Employees managing other employees (recursive relationships)\n",
"- Department structure with chairs and budgets\n",
"- Organizational hierarchies and reporting chains\n",
"- One-to-one relationships (department chairs)\n",
"- Normalized department data (codes, names, budgets, locations)\n",
"\n",
"### Scientific Examples\n",
"\n",
"Real-world scientific applications demonstrating DataJoint in research contexts.\n",
"\n",
"#### [Allen Common Coordinate Framework](065-allen-ccf.ipynb)\n",
"The Allen Brain Atlas coordinate system for mouse brain anatomy. This example illustrates:\n",
"- 3D spatial coordinates and brain structure atlases\n",
"- Hierarchical anatomical relationships\n",
"- Integration with neuroimaging data\n",
"- Real scientific data pipeline from the DataJoint Elements project\n",
"- Published standards in neuroscience research\n",
"\n",
"#### [Julia Sets](070-julia.ipynb)\n",
"Computational visualization of Julia sets from fractal mathematics. This example demonstrates:\n",
"- Computed tables for mathematical functions\n",
"- Parameter spaces and computational workflows\n",
"- Image generation and visualization\n",
"- Using DataJoint for reproducible computational art\n",
"- Automatic computation with `populate()`\n",
"\n",
"---\n",
"\n",
"Each example is self-contained with:\n",
"- Complete schema definitions\n",
"- Sample data population\n",
"- Example queries demonstrating key concepts\n",
"- Visual diagrams showing table relationships\n",
"- Code that you can run and modify\n",
"\n",
"Browse through these examples to see different design patterns in action and learn how to apply DataJoint principles to your own domains.\n"
]
"source": "## Overview of Examples\n\nThis section presents a variety of schema examples that demonstrate different aspects of DataJoint design principles. Each example showcases specific patterns, relationships, and use cases ranging from classic database tutorials to real-world scientific applications.\n\n### Classic Database Examples\n\nThese examples are adapted from well-known database tutorials to show how traditional relational designs map to DataJoint's entity-workflow model.\n\n#### [Classic Sales Database](010-classic-sales.ipynb)\nThe classic MySQL tutorial sales database featuring customers, orders, products, and employees. This example demonstrates:\n- Traditional business database design\n- Many-to-many relationships through order details\n- Employee management hierarchies\n- Product lines and order fulfillment\n\n#### [University Database](015-university.ipynb)\nA university course enrollment system with students, courses, instructors, and enrollments. This example illustrates:\n- Academic record keeping\n- Course registration workflows\n- Student-course many-to-many relationships\n- Grade tracking and prerequisites\n\n#### [Nations Database](030-nations.ipynb)\nA geographical database with countries, regions, and continents from the MariaDB tutorial. This example shows:\n- Hierarchical geographical relationships\n- Lookup tables for standardized data\n- Regional groupings and classifications\n\n### Conceptual Examples\n\nThese examples focus on specific design patterns and conceptual challenges in database modeling.\n\n#### [Hotel Reservation System](040-hotel.ipynb)\nA complete hotel management system with rooms, reservations, check-ins, and check-outs. This design exercise demonstrates:\n- Time-series data (room availability and pricing)\n- Business rule enforcement (no double-booking, check-in requires reservation)\n- Guest management and payment processing\n- Temporal queries (who stayed when, room history)\n\n#### [Social Generations](044-generations.ipynb)\nDefines social generations as birth cohorts sharing cultural and historical experiences. This example explores:\n- Lookup tables for reference data\n- Birth year ranges and generational characteristics\n- Cultural archetypes and life principles\n- Using DataJoint to model sociological concepts\n\n#### [Languages and Proficiency](050-languages.ipynb)\nA many-to-many relationship design tracking people and their language skills using international standards. This comprehensive example demonstrates:\n- **ISO 639-1 language codes**: Standardized two-letter codes for major world languages\n- **CEFR proficiency levels**: Common European Framework of Reference for Languages (A1-C2)\n- **Association tables**: `Proficiency` as a workflow step linking people, languages, and levels\n- **Lookup tables**: Both `Language` and `CEFRLevel` with predefined, standardized content\n- **International standards**: Using established frameworks ensures consistency and compatibility\n- **Sample queries**: Finding multilingual individuals, proficient speakers, and language statistics\n\n### Organizational Examples\n\nThese examples model organizational structures and hierarchies.\n\n#### [Management Hierarchy](060-management.ipynb)\nDemonstrates self-referencing tables and organizational relationships. This example shows:\n- Employees managing other employees (recursive relationships)\n- Department structure with chairs and budgets\n- Organizational hierarchies and reporting chains\n- One-to-one relationships (department chairs)\n- Normalized department data (codes, names, budgets, locations)\n\n### Scientific Examples\n\nReal-world scientific applications demonstrating DataJoint in research contexts.\n\n#### [Allen Common Coordinate Framework](065-allen-ccf.ipynb)\nThe Allen Brain Atlas coordinate system for mouse brain anatomy. This example illustrates:\n- 3D spatial coordinates and brain structure atlases\n- Hierarchical anatomical relationships\n- Integration with neuroimaging data\n- Real scientific data pipeline from the DataJoint Elements project\n- Published standards in neuroscience research\n\n#### [Julia Fractals](070-fractals.ipynb)\nComputational visualization of Julia sets from fractal mathematics. This example demonstrates:\n- Computed tables for mathematical functions\n- Parameter spaces and computational workflows\n- Image generation and visualization\n- Using DataJoint for reproducible computational art\n- Automatic computation with `populate()`\n\n#### [Blob Detection Pipeline](075-blob-detection.ipynb)\nAn image analysis pipeline that detects bright blobs in images. This example demonstrates:\n- Master-part table relationships for computational workflows\n- Lookup tables for algorithm parameters\n- Computed tables with automatic population\n- Visualization of detection results\n- Atomic transactions for workflow integrity\n\n---\n\nEach example is self-contained with:\n- Complete schema definitions\n- Sample data population\n- Example queries demonstrating key concepts\n- Visual diagrams showing table relationships\n- Code that you can run and modify\n\nBrowse through these examples to see different design patterns in action and learn how to apply DataJoint principles to your own domains."
}
],
"metadata": {
Expand Down
10 changes: 0 additions & 10 deletions book/80-examples/010-classic-sales.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
"Because we run against the canonical SQL definitions, you can compare the DataJoint diagrams directly with the diagrams that appear in business-database textbooks. It also illustrates how DataJoint fits into an existing workflow—you can adopt legacy schemas while gaining the benefits of workflow execution, cascading deletes, and DAG-based querying.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 6,
Expand Down Expand Up @@ -587,11 +582,6 @@
"\n",
"From here you can explore the database using either SQL (`%sql`) or DataJoint operators. Because the schema follows the relational workflow model, joins such as `Order * Payment` or `Product * Order.Details` naturally trace the same business processes that the foreign keys encode. Try recreating some of the analytical queries from the MySQL tutorial using DataJoint’s restriction (`&`), projection (`.proj()`), and aggregation (`.aggr()`) operators to see how workflow-aware queries feel in a classic OLTP dataset.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
}
],
"metadata": {
Expand Down
12 changes: 1 addition & 11 deletions book/80-examples/016-university-queries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1808,11 +1808,6 @@
"The restriction operators & and - can use other queries as conditions."
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 16,
Expand Down Expand Up @@ -2521,11 +2516,6 @@
"# Joins"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "code",
"execution_count": 22,
Expand Down Expand Up @@ -3528,4 +3518,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
Loading