Skip to content

Commit c9ca662

Browse files
Aggregations
1 parent 2ea7abb commit c9ca662

File tree

8 files changed

+5574
-1719
lines changed

8 files changed

+5574
-1719
lines changed

db-course/004-DatabaseHotel.ipynb

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

db-course/004-DatabaseNations.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
},
1010
{
1111
"cell_type": "code",
12-
"execution_count": 2,
12+
"execution_count": 1,
1313
"metadata": {},
1414
"outputs": [],
1515
"source": [
@@ -23,7 +23,7 @@
2323
},
2424
{
2525
"cell_type": "code",
26-
"execution_count": 5,
26+
"execution_count": 2,
2727
"metadata": {},
2828
"outputs": [
2929
{
@@ -140,7 +140,7 @@
140140
"[]"
141141
]
142142
},
143-
"execution_count": 5,
143+
"execution_count": 2,
144144
"metadata": {},
145145
"output_type": "execute_result"
146146
}

db-course/004-DatabaseUniversity.ipynb

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

db-course/004-Design.ipynb

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"name": "stderr",
3131
"output_type": "stream",
3232
"text": [
33-
"[2023-10-18 00:11:41,855][INFO]: Connecting [email protected]:3306\n",
34-
"[2023-10-18 00:11:41,862][INFO]: Connected [email protected]:3306\n"
33+
"[2023-10-24 23:22:27,667][INFO]: Connecting [email protected]:3306\n",
34+
"[2023-10-24 23:22:27,674][INFO]: Connected [email protected]:3306\n"
3535
]
3636
}
3737
],
@@ -334,9 +334,9 @@
334334
"</g>\n",
335335
"</g>\n",
336336
"<!-- Purchase -->\n",
337-
"<g id=\"node4\" class=\"node\">\n",
337+
"<g id=\"node3\" class=\"node\">\n",
338338
"<title>Purchase</title>\n",
339-
"<g id=\"a_node4\"><a xlink:title=\"→ Account\r→ AddOn\r------------------------------\r→ CreditCard\rpurchase_date        \r\">\n",
339+
"<g id=\"a_node3\"><a xlink:title=\"→ Account\r→ AddOn\r------------------------------\r→ CreditCard\rpurchase_date        \r\">\n",
340340
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\" points=\"136.5,-35 68.5,-35 68.5,0 136.5,0 136.5,-35\"/>\n",
341341
"<text text-anchor=\"middle\" x=\"102.5\" y=\"-14.4\" font-family=\"arial\" font-size=\"12.00\" fill=\"darkgreen\">Purchase</text>\n",
342342
"</a>\n",
@@ -362,9 +362,9 @@
362362
"<path fill=\"none\" stroke=\"#000000\" stroke-width=\"0.75\" stroke-dasharray=\"5,2\" stroke-opacity=\"0.250980\" d=\"M102.5,-70.8C102.5,-59.95 102.5,-45.87 102.5,-35.05\"/>\n",
363363
"</g>\n",
364364
"<!-- Account -->\n",
365-
"<g id=\"node3\" class=\"node\">\n",
365+
"<g id=\"node4\" class=\"node\">\n",
366366
"<title>Account</title>\n",
367-
"<g id=\"a_node3\"><a xlink:title=\"phone                \r------------------------------\rfirst_name           \rlast_name            \rdob=null             \rsex=&quot;&quot;               \r\">\n",
367+
"<g id=\"a_node4\"><a xlink:title=\"phone                \r------------------------------\rfirst_name           \rlast_name            \rdob=null             \rsex=&quot;&quot;               \r\">\n",
368368
"<polygon fill=\"#00ff00\" fill-opacity=\"0.188235\" stroke=\"#00ff00\" stroke-opacity=\"0.188235\" points=\"165.5,-177 105.5,-177 105.5,-142 165.5,-142 165.5,-177\"/>\n",
369369
"<text text-anchor=\"start\" x=\"113.5\" y=\"-157.4\" font-family=\"arial\" text-decoration=\"underline\" font-size=\"12.00\" fill=\"darkgreen\">Account</text>\n",
370370
"</a>\n",
@@ -384,7 +384,7 @@
384384
"</svg>"
385385
],
386386
"text/plain": [
387-
"<datajoint.diagram.Diagram at 0x7fe7341d82e0>"
387+
"<datajoint.diagram.Diagram at 0x7f5acf03e280>"
388388
]
389389
},
390390
"execution_count": 8,
@@ -539,55 +539,55 @@
539539
" <p id=\"nonprimary\">sex</p>\n",
540540
" <span class=\"djtooltiptext\"></span>\n",
541541
" </div> </th> </tr> </thead>\n",
542-
" <tbody> <tr> <td>10003214241</td>\n",
543-
"<td>Samantha</td>\n",
544-
"<td>Johnson</td>\n",
545-
"<td>1948-01-03</td>\n",
546-
"<td>F</td></tr><tr><td>10013304597</td>\n",
547-
"<td>Keith</td>\n",
548-
"<td>Page</td>\n",
549-
"<td>1981-06-02</td>\n",
550-
"<td>M</td></tr><tr><td>10019792010</td>\n",
551-
"<td>Greg</td>\n",
552-
"<td>Matthews</td>\n",
553-
"<td>1964-06-26</td>\n",
554-
"<td>M</td></tr><tr><td>10022078153</td>\n",
555-
"<td>Tammy</td>\n",
556-
"<td>Thompson</td>\n",
557-
"<td>1998-02-18</td>\n",
558-
"<td>F</td></tr><tr><td>10023766171</td>\n",
559-
"<td>Dominic</td>\n",
560-
"<td>Marshall</td>\n",
561-
"<td>1954-12-05</td>\n",
562-
"<td>M</td></tr><tr><td>10039535776</td>\n",
563-
"<td>Rachel</td>\n",
564-
"<td>Grant</td>\n",
565-
"<td>1910-04-13</td>\n",
566-
"<td>F</td></tr><tr><td>10042202885</td>\n",
567-
"<td>Dale</td>\n",
568-
"<td>Dawson</td>\n",
569-
"<td>1913-04-29</td>\n",
570-
"<td>M</td></tr><tr><td>10042418609</td>\n",
571-
"<td>Kimberly</td>\n",
572-
"<td>Hoffman</td>\n",
573-
"<td>1934-07-15</td>\n",
574-
"<td>F</td></tr><tr><td>10043174442</td>\n",
575-
"<td>Zachary</td>\n",
576-
"<td>Sharp</td>\n",
577-
"<td>1974-03-18</td>\n",
578-
"<td>M</td></tr><tr><td>10044400960</td>\n",
579-
"<td>Thomas</td>\n",
580-
"<td>Lin</td>\n",
581-
"<td>1989-06-02</td>\n",
582-
"<td>M</td></tr><tr><td>10046630170</td>\n",
583-
"<td>Heather</td>\n",
584-
"<td>Young</td>\n",
585-
"<td>1932-01-15</td>\n",
586-
"<td>F</td></tr><tr><td>10053952518</td>\n",
587-
"<td>Michelle</td>\n",
588-
"<td>Gonzalez</td>\n",
589-
"<td>2006-02-12</td>\n",
590-
"<td>F</td> </tr> </tbody>\n",
542+
" <tbody> <tr> <td>10013740006</td>\n",
543+
"<td>Gina</td>\n",
544+
"<td>Shaw</td>\n",
545+
"<td>1914-11-23</td>\n",
546+
"<td>F</td></tr><tr><td>10016834227</td>\n",
547+
"<td>Elizabeth</td>\n",
548+
"<td>Weeks</td>\n",
549+
"<td>1936-09-04</td>\n",
550+
"<td>F</td></tr><tr><td>10019159850</td>\n",
551+
"<td>Joshua</td>\n",
552+
"<td>Mcdowell</td>\n",
553+
"<td>2007-12-14</td>\n",
554+
"<td>M</td></tr><tr><td>10027902431</td>\n",
555+
"<td>Robert</td>\n",
556+
"<td>Bailey</td>\n",
557+
"<td>2002-10-16</td>\n",
558+
"<td>M</td></tr><tr><td>10052023046</td>\n",
559+
"<td>Peter</td>\n",
560+
"<td>English</td>\n",
561+
"<td>2023-09-22</td>\n",
562+
"<td>M</td></tr><tr><td>10060545047</td>\n",
563+
"<td>Latoya</td>\n",
564+
"<td>Cohen</td>\n",
565+
"<td>1917-01-02</td>\n",
566+
"<td>F</td></tr><tr><td>10074130737</td>\n",
567+
"<td>Gina</td>\n",
568+
"<td>Walters</td>\n",
569+
"<td>2023-09-24</td>\n",
570+
"<td>F</td></tr><tr><td>10079483739</td>\n",
571+
"<td>Gina</td>\n",
572+
"<td>Compton</td>\n",
573+
"<td>1934-08-10</td>\n",
574+
"<td>F</td></tr><tr><td>10089699053</td>\n",
575+
"<td>Terri</td>\n",
576+
"<td>Reid</td>\n",
577+
"<td>1987-05-22</td>\n",
578+
"<td>F</td></tr><tr><td>10091646939</td>\n",
579+
"<td>Katherine</td>\n",
580+
"<td>Hernandez</td>\n",
581+
"<td>1979-07-26</td>\n",
582+
"<td>F</td></tr><tr><td>10092272331</td>\n",
583+
"<td>Linda</td>\n",
584+
"<td>Gross</td>\n",
585+
"<td>1984-08-15</td>\n",
586+
"<td>F</td></tr><tr><td>10110229863</td>\n",
587+
"<td>Brandon</td>\n",
588+
"<td>Jones</td>\n",
589+
"<td>1951-12-04</td>\n",
590+
"<td>M</td> </tr> </tbody>\n",
591591
" </table>\n",
592592
" <p>...</p>\n",
593593
" <p>Total: 10501</p></div>\n",
@@ -596,18 +596,18 @@
596596
"text/plain": [
597597
"*phone first_name last_name dob sex \n",
598598
"+------------+ +------------+ +-----------+ +------------+ +-----+\n",
599-
"10003214241 Samantha Johnson 1948-01-03 F \n",
600-
"10013304597 Keith Page 1981-06-02 M \n",
601-
"10019792010 Greg Matthews 1964-06-26 M \n",
602-
"10022078153 Tammy Thompson 1998-02-18 F \n",
603-
"10023766171 Dominic Marshall 1954-12-05 M \n",
604-
"10039535776 Rachel Grant 1910-04-13 F \n",
605-
"10042202885 Dale Dawson 1913-04-29 M \n",
606-
"10042418609 Kimberly Hoffman 1934-07-15 F \n",
607-
"10043174442 Zachary Sharp 1974-03-18 M \n",
608-
"10044400960 Thomas Lin 1989-06-02 M \n",
609-
"10046630170 Heather Young 1932-01-15 F \n",
610-
"10053952518 Michelle Gonzalez 2006-02-12 F \n",
599+
"10013740006 Gina Shaw 1914-11-23 F \n",
600+
"10016834227 Elizabeth Weeks 1936-09-04 F \n",
601+
"10019159850 Joshua Mcdowell 2007-12-14 M \n",
602+
"10027902431 Robert Bailey 2002-10-16 M \n",
603+
"10052023046 Peter English 2023-09-22 M \n",
604+
"10060545047 Latoya Cohen 1917-01-02 F \n",
605+
"10074130737 Gina Walters 2023-09-24 F \n",
606+
"10079483739 Gina Compton 1934-08-10 F \n",
607+
"10089699053 Terri Reid 1987-05-22 F \n",
608+
"10091646939 Katherine Hernandez 1979-07-26 F \n",
609+
"10092272331 Linda Gross 1984-08-15 F \n",
610+
"10110229863 Brandon Jones 1951-12-04 M \n",
611611
" ...\n",
612612
" (Total: 10501)"
613613
]

db-course/004-DesignSQL.ipynb

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,13 @@
2828
"%load_ext sql\n",
2929
"%config SqlMagic.autocommit=True\n",
3030
"\n",
31-
"connection_string = \"mysql://root:[email protected]\""
31+
"%sql mysql://root:[email protected]"
3232
]
3333
},
3434
{
3535
"cell_type": "code",
3636
"execution_count": 2,
3737
"metadata": {},
38-
"outputs": [],
39-
"source": [
40-
"%sql $connection_string"
41-
]
42-
},
43-
{
44-
"cell_type": "code",
45-
"execution_count": 3,
46-
"metadata": {},
4738
"outputs": [
4839
{
4940
"name": "stdout",
@@ -59,7 +50,7 @@
5950
"[]"
6051
]
6152
},
62-
"execution_count": 3,
53+
"execution_count": 2,
6354
"metadata": {},
6455
"output_type": "execute_result"
6556
}

0 commit comments

Comments
 (0)