Skip to content

Commit 09ccc95

Browse files
organize sections on adapted types, attachements, and filepaths
1 parent 2c02fca commit 09ccc95

File tree

6 files changed

+632
-58
lines changed

6 files changed

+632
-58
lines changed

book/30-schema-design/010-schema.ipynb

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
" - date: 2025-01-12\n",
1212
"---\n",
1313
"\n",
14-
"# Create Schemas\n",
15-
"\n",
16-
"## What is a schema?\n",
14+
"# What is a schema?\n",
1715
"\n",
1816
"The term schema has two related meanings in the context of databases:\n",
1917
"\n",
20-
"### 1. Schema as a Data Blueprint\n",
18+
"## 1. Schema as a Data Blueprint\n",
2119
"A **schema** is a formal specification of the structure of data and the rules governing its integrity.\n",
2220
"It serves as a blueprint that defines how data is organized, stored, and accessed within a database.\n",
2321
"This ensures that the database reflects the rules and requirements of the underlying business or research project it supports.\n",
@@ -27,20 +25,20 @@
2725
"* Rules and constraints that ensure data consistency, accuracy, and reliability.\n",
2826
"* Relationships between tables, such as primary keys (unique identifiers for records) and foreign keys (references to related records in other tables).\n",
2927
"\n",
30-
"#### Aims of Good Schema Design\n",
28+
"### Aims of Good Schema Design\n",
3129
"* **Data Integrity**: Ensures consistency and prevents anomalies.\n",
3230
"* **Query Efficiency**: Facilitates fast and accurate data retrieval, supports complex queries, and optimizes database performance.\n",
3331
"* **Scalability**: Allows the database to grow and adapt as data volumes increase.\n",
3432
"\n",
35-
"#### Key Elements of Schema Design\n",
33+
"### Key Elements of Schema Design\n",
3634
"* **Tables and Attributes**: Each table is defined with specific attributes (columns), each assigned a data type.\n",
3735
"* **Primary Keys**: Uniquely identify each record in a table.\n",
3836
"* **Foreign Keys**: Establish relationships between entities in tables.\n",
3937
"* **Indexes**: Support efficient queries.\n",
4038
"\n",
4139
"Through 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",
4240
"\n",
43-
"### 2. Schema as a Database Module\n",
41+
"## 2. Schema as a Database Module\n",
4442
"\n",
4543
"In 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. \n",
4644
"This modular approach:\n",
@@ -100,13 +98,6 @@
10098
"With this foundation, you are ready to begin declaring tables and building your data pipeline."
10199
]
102100
},
103-
{
104-
"cell_type": "code",
105-
"execution_count": null,
106-
"metadata": {},
107-
"outputs": [],
108-
"source": []
109-
},
110101
{
111102
"cell_type": "markdown",
112103
"metadata": {},

book/30-schema-design/083-attach.ipynb

Lines changed: 24 additions & 24 deletions
Large diffs are not rendered by default.

book/30-schema-design/084-filepath.ipynb

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
{
22
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Filepaths"
8+
]
9+
},
310
{
411
"cell_type": "code",
512
"execution_count": 1,
@@ -1293,10 +1300,10 @@
12931300
"<!-- StateFlower -->\n",
12941301
"<g class=\"node\" id=\"node1\">\n",
12951302
"<title>StateFlower</title>\n",
1296-
"<g id=\"a_node1\"><a xlink:title=\"→ State\r",
1297-
"------------------------------\r",
1298-
"flower_image         \r",
1299-
"INDEX (flower_image)\r",
1303+
"<g id=\"a_node1\"><a xlink:title=\"→ State\r\n",
1304+
"------------------------------\r\n",
1305+
"flower_image         \r\n",
1306+
"INDEX (flower_image)\r\n",
13001307
"\">\n",
13011308
"<ellipse cx=\"50.625\" cy=\"-17.5\" fill=\"#00007f\" fill-opacity=\"0.250980\" rx=\"50.7503\" ry=\"17.5\" stroke=\"#00007f\" stroke-opacity=\"0.250980\"/>\n",
13021309
"<text fill=\"#00007f\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"50.625\" y=\"-14.4\">StateFlower</text>\n",
@@ -1306,9 +1313,9 @@
13061313
"<!-- State -->\n",
13071314
"<g class=\"node\" id=\"node2\">\n",
13081315
"<title>State</title>\n",
1309-
"<g id=\"a_node2\"><a xlink:title=\"state_code           \r",
1310-
"------------------------------\r",
1311-
"state                \r",
1316+
"<g id=\"a_node2\"><a xlink:title=\"state_code           \r\n",
1317+
"------------------------------\r\n",
1318+
"state                \r\n",
13121319
"\">\n",
13131320
"<polygon fill=\"#000000\" fill-opacity=\"0.125490\" points=\"125.625,-106 85.625,-106 85.625,-71 125.625,-71 125.625,-106\" stroke=\"transparent\"/>\n",
13141321
"<text fill=\"#000000\" font-family=\"arial\" font-size=\"10.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"93.625\" y=\"-87\">State</text>\n",
@@ -1323,10 +1330,10 @@
13231330
"<!-- StateBird -->\n",
13241331
"<g class=\"node\" id=\"node5\">\n",
13251332
"<title>StateBird</title>\n",
1326-
"<g id=\"a_node5\"><a xlink:title=\"→ State\r",
1327-
"------------------------------\r",
1328-
"bird_image           \r",
1329-
"INDEX (bird_image)\r",
1333+
"<g id=\"a_node5\"><a xlink:title=\"→ State\r\n",
1334+
"------------------------------\r\n",
1335+
"bird_image           \r\n",
1336+
"INDEX (bird_image)\r\n",
13301337
"\">\n",
13311338
"<ellipse cx=\"160.625\" cy=\"-17.5\" fill=\"#00007f\" fill-opacity=\"0.250980\" rx=\"41.0015\" ry=\"17.5\" stroke=\"#00007f\" stroke-opacity=\"0.250980\"/>\n",
13321339
"<text fill=\"#00007f\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"160.625\" y=\"-14.4\">StateBird</text>\n",
@@ -1341,9 +1348,9 @@
13411348
"<!-- Organization -->\n",
13421349
"<g class=\"node\" id=\"node3\">\n",
13431350
"<title>Organization</title>\n",
1344-
"<g id=\"a_node3\"><a xlink:title=\"organization         \r",
1345-
"------------------------------\r",
1346-
"logo_url             \r",
1351+
"<g id=\"a_node3\"><a xlink:title=\"organization         \r\n",
1352+
"------------------------------\r\n",
1353+
"logo_url             \r\n",
13471354
"\">\n",
13481355
"<polygon fill=\"#000000\" fill-opacity=\"0.125490\" points=\"283.125,-106 212.125,-106 212.125,-71 283.125,-71 283.125,-106\" stroke=\"transparent\"/>\n",
13491356
"<text fill=\"#000000\" font-family=\"arial\" font-size=\"10.00\" text-anchor=\"start\" text-decoration=\"underline\" x=\"220.125\" y=\"-87\">Organization</text>\n",
@@ -1353,10 +1360,10 @@
13531360
"<!-- Logo -->\n",
13541361
"<g class=\"node\" id=\"node4\">\n",
13551362
"<title>Logo</title>\n",
1356-
"<g id=\"a_node4\"><a xlink:title=\"→ Organization\r",
1357-
"------------------------------\r",
1358-
"logo_image           \r",
1359-
"INDEX (logo_image)\r",
1363+
"<g id=\"a_node4\"><a xlink:title=\"→ Organization\r\n",
1364+
"------------------------------\r\n",
1365+
"logo_image           \r\n",
1366+
"INDEX (logo_image)\r\n",
13601367
"\">\n",
13611368
"<ellipse cx=\"247.625\" cy=\"-17.5\" fill=\"#00007f\" fill-opacity=\"0.250980\" rx=\"27.5\" ry=\"17.5\" stroke=\"#00007f\" stroke-opacity=\"0.250980\"/>\n",
13621369
"<text fill=\"#00007f\" font-family=\"arial\" font-size=\"12.00\" text-anchor=\"middle\" x=\"247.625\" y=\"-14.4\">Logo</text>\n",

book/30-schema-design/086-adapted-types.ipynb

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)