diff --git a/SQL sandbox.ipynb b/SQL sandbox.ipynb index f3318a035f1f1856738968c85a5610a1f7e03e84..7e8403b88db48e2225f7d0813ca61bbaeb9ff502 100644 --- a/SQL sandbox.ipynb +++ b/SQL sandbox.ipynb @@ -25,95 +25,108 @@ "cell_type": "code", "execution_count": 1, "id": "cf6ab1d7-a631-4e6e-8423-76d0fe89346e", - "metadata": {}, - "outputs": [], + "metadata": { + "tags": [] + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Mocodo 3.1.1 loaded.\n" + ] + } + ], "source": [ - "%reload_ext mocodo_magic" + "%reload_ext mocodo" ] }, { "cell_type": "code", "execution_count": 2, "id": "03b3dec1-10c1-4018-88e0-9c0c750d8b60", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "data": { "image/svg+xml": [ - "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:link=\"http://www.w3.org/1999/xlink\" width=\"364\" height=\"200\" view_box=\"0 0 364 200\">\n", - "\n", - "<desc>Generated by Mocodo 2.3.9 on Wed, 17 Nov 2021 20:50:42</desc>\n", - "\n", - "<rect id=\"frame\" x=\"0\" y=\"0\" width=\"364\" height=\"200\" fill=\"none\" stroke=\"none\" stroke-width=\"0\"/>\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"364\" height=\"200\" viewBox=\"0 0 364 200\">\n", + "<rect id=\"frame\" x=\"0\" y=\"0\" width=\"364\" height=\"200\" fill=\"#FFF\" stroke=\"none\" stroke-width=\"0\"/>\n", "\n", "<!-- Association Inclut -->\n", - "<line x1=\"316\" y1=\"44\" x2=\"203\" y2=\"44\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<text x=\"249\" y=\"36.0\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"12\">1,N</text>\n", - "<line x1=\"69\" y1=\"44\" x2=\"203\" y2=\"44\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<text x=\"134\" y=\"60.0\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"12\">0,N</text>\n", - "<g id=\"association-Inclut\">\n", - "\t<path d=\"M 230 18 a 14 14 90 0 1 14 14 V 44 h -82 V 32 a 14 14 90 0 1 14 -14\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t<path d=\"M 244 44.0 v 12 a 14 14 90 0 1 -14 14 H 176 a 14 14 90 0 1 -14 -14 V 44.0 H 82\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t<rect x=\"162\" y=\"18\" width=\"82\" height=\"52\" fill=\"none\" rx=\"14\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t<line x1=\"162\" y1=\"44\" x2=\"244\" y2=\"44\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"177\" y=\"36.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">Inclut</text>\n", - "\t<text x=\"169\" y=\"62.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">Quantité</text>\n", + "<g>\n", + "\t<line x1=\"316\" y1=\"44\" x2=\"203\" y2=\"44\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"249\" y=\"36\" fill=\"#000\" font-family=\"Courier New\" font-size=\"12\">1,N</text>\n", + "\t<line x1=\"69\" y1=\"44\" x2=\"203\" y2=\"44\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"134\" y=\"60\" fill=\"#000\" font-family=\"Courier New\" font-size=\"12\">0,N</text>\n", + "\t<g>\n", + "\t\t<path d=\"M230 18 a14 14 90 0 1 14 14 V44 h-82 V32 a14 14 90 0 1 14 -14\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\"/>\n", + "\t\t<path d=\"M244 44 v12 a14 14 90 0 1 -14 14 H176 a14 14 90 0 1 -14 -14 V44 H82\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\"/>\n", + "\t\t<rect x=\"162\" y=\"18\" width=\"82\" height=\"52\" fill=\"none\" rx=\"14\" stroke=\"#000\" stroke-width=\"1.5\"/>\n", + "\t\t<line x1=\"162\" y1=\"44\" x2=\"244\" y2=\"44\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t\t<text x=\"177\" y=\"36.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">Inclut</text>\n", + "\t\t<text x=\"169\" y=\"62.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">Quantité</text>\n", + "\t</g>\n", "</g>\n", "\n", "<!-- Association Passe -->\n", - "<line x1=\"69\" y1=\"147\" x2=\"203\" y2=\"147\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<text x=\"105\" y=\"163.0\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"12\">0,N</text>\n", - "<line x1=\"316\" y1=\"44\" x2=\"203\" y2=\"147\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<text x=\"275.993404926436\" y=\"95\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"12\">1,1</text>\n", - "<g id=\"association-Passe\">\n", - "\t<path d=\"M 218 121 a 14 14 90 0 1 14 14 V 147 h -58 V 135 a 14 14 90 0 1 14 -14\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t<path d=\"M 232 147.0 v 12 a 14 14 90 0 1 -14 14 H 188 a 14 14 90 0 1 -14 -14 V 147.0 H 58\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t<rect x=\"174\" y=\"121\" width=\"58\" height=\"52\" fill=\"none\" rx=\"14\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t<line x1=\"174\" y1=\"147\" x2=\"232\" y2=\"147\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"181\" y=\"139.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">Passe</text>\n", + "<g>\n", + "\t<line x1=\"69\" y1=\"147\" x2=\"203\" y2=\"147\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"105\" y=\"163\" fill=\"#000\" font-family=\"Courier New\" font-size=\"12\">0,N</text>\n", + "\t<line x1=\"316\" y1=\"44\" x2=\"203\" y2=\"147\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"275.99\" y=\"95\" fill=\"#000\" font-family=\"Courier New\" font-size=\"12\">1,1</text>\n", + "\t<g>\n", + "\t\t<path d=\"M218 121 a14 14 90 0 1 14 14 V147 h-58 V135 a14 14 90 0 1 14 -14\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\"/>\n", + "\t\t<path d=\"M232 147 v12 a14 14 90 0 1 -14 14 H188 a14 14 90 0 1 -14 -14 V147 H58\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\"/>\n", + "\t\t<rect x=\"174\" y=\"121\" width=\"58\" height=\"52\" fill=\"none\" rx=\"14\" stroke=\"#000\" stroke-width=\"1.5\"/>\n", + "\t\t<line x1=\"174\" y1=\"147\" x2=\"232\" y2=\"147\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t\t<text x=\"182\" y=\"139.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">Passe</text>\n", + "\t</g>\n", "</g>\n", "\n", "<!-- Entity PRODUIT -->\n", - "<g id=\"entity-PRODUIT\">\n", - "\t<g id=\"frame-PRODUIT\">\n", - "\t\t<rect x=\"9\" y=\"9\" width=\"120\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"9\" y=\"35.0\" width=\"120\" height=\"44\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"9\" y=\"9\" width=\"120\" height=\"70\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"9\" y1=\"35\" x2=\"129\" y2=\"35\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"9\" y=\"9\" width=\"120\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"9\" y=\"35\" width=\"120\" height=\"44\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"9\" y=\"9\" width=\"120\" height=\"70\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"9\" y1=\"35\" x2=\"129\" y2=\"35\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"39\" y=\"27.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">PRODUIT</text>\n", - "\t<text x=\"14\" y=\"53.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">code</text>\n", - "\t<line x1=\"14\" y1=\"56.0\" x2=\"49\" y2=\"56.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"14\" y=\"71.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">prix_unitaire</text>\n", + "\t<text x=\"39\" y=\"27.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">PRODUIT</text>\n", + "\t<text x=\"14\" y=\"53.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">code</text>\n", + "\t<line x1=\"14\" y1=\"56\" x2=\"49\" y2=\"56\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"14\" y=\"71.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">prix_unitaire</text>\n", "</g>\n", "\n", "<!-- Entity COMMANDE -->\n", - "<g id=\"entity-COMMANDE\">\n", - "\t<g id=\"frame-COMMANDE\">\n", - "\t\t<rect x=\"277\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"277\" y=\"35.0\" width=\"78\" height=\"44\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"277\" y=\"9\" width=\"78\" height=\"70\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"277\" y1=\"35\" x2=\"355\" y2=\"35\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"277\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"277\" y=\"35\" width=\"78\" height=\"44\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"277\" y=\"9\" width=\"78\" height=\"70\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"277\" y1=\"35\" x2=\"355\" y2=\"35\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"282\" y=\"27.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">COMMANDE</text>\n", - "\t<text x=\"282\" y=\"53.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">numero</text>\n", - "\t<line x1=\"282\" y1=\"56.0\" x2=\"334\" y2=\"56.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"282\" y=\"71.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">date</text>\n", + "\t<text x=\"282\" y=\"27.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">COMMANDE</text>\n", + "\t<text x=\"282\" y=\"53.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">numero</text>\n", + "\t<line x1=\"282\" y1=\"56\" x2=\"334\" y2=\"56\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"282\" y=\"71.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">date</text>\n", "</g>\n", "\n", "<!-- Entity CLIENT -->\n", - "<g id=\"entity-CLIENT\">\n", - "\t<g id=\"frame-CLIENT\">\n", - "\t\t<rect x=\"38\" y=\"103\" width=\"62\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"38\" y=\"129.0\" width=\"62\" height=\"62\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"38\" y=\"103\" width=\"62\" height=\"88\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"38\" y1=\"129\" x2=\"100\" y2=\"129\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"38\" y=\"103\" width=\"62\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"38\" y=\"129\" width=\"62\" height=\"62\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"38\" y=\"103\" width=\"62\" height=\"88\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"38\" y1=\"129\" x2=\"100\" y2=\"129\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"43\" y=\"121.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">CLIENT</text>\n", - "\t<text x=\"43\" y=\"147.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">email</text>\n", - "\t<line x1=\"43\" y1=\"150.0\" x2=\"86\" y2=\"150.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"43\" y=\"165.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">nom</text>\n", - "\t<text x=\"43\" y=\"183.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">prenom</text>\n", + "\t<text x=\"43\" y=\"121.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">CLIENT</text>\n", + "\t<text x=\"43\" y=\"147.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">email</text>\n", + "\t<line x1=\"43\" y1=\"150\" x2=\"86\" y2=\"150\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"43\" y=\"165.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">nom</text>\n", + "\t<text x=\"43\" y=\"183.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">prenom</text>\n", "</g>\n", "</svg>" ], @@ -140,30 +153,30 @@ "<body>\n", "<div id='mld'>\n", "<div>\n", - " <span class='relation'>PRODUIT</span> (\n", - " <span class='primary'>code</span>,\n", - " <span class='normal'>prix_unitaire</span>\n", - " )\n", - "</div>\n", - "<div>\n", - " <span class='relation'>Inclut</span> (\n", - " <span class='foreign primary'>numero</span>,\n", - " <span class='foreign primary'>code</span>,\n", - " <span class='normal'>Quantité</span>\n", + " <span class='relation'>CLIENT</span> (\n", + " <span class='primary'>email</span>,\n", + " <span class='normal'>nom</span>,\n", + " <span class='normal'>prenom</span>\n", " )\n", "</div>\n", "<div>\n", " <span class='relation'>COMMANDE</span> (\n", " <span class='primary'>numero</span>,\n", " <span class='normal'>date</span>,\n", - " <span class='foreign'>email</span>\n", + " <span class='foreign'>#email</span>\n", " )\n", "</div>\n", "<div>\n", - " <span class='relation'>CLIENT</span> (\n", - " <span class='primary'>email</span>,\n", - " <span class='normal'>nom</span>,\n", - " <span class='normal'>prenom</span>\n", + " <span class='relation'>Inclut</span> (\n", + " <span class='foreign primary'>#numero</span>,\n", + " <span class='foreign primary'>#code</span>,\n", + " <span class='normal'>Quantité</span>\n", + " )\n", + "</div>\n", + "<div>\n", + " <span class='relation'>PRODUIT</span> (\n", + " <span class='primary'>code</span>,\n", + " <span class='normal'>prix_unitaire</span>\n", " )\n", "</div>\n", "</div>\n", @@ -192,19 +205,21 @@ "cell_type": "code", "execution_count": 3, "id": "14236e0f-3be3-4a0a-9e5a-85b6693fbd8a", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "data": { "text/markdown": [ - "- code\n", - "- prix_unitaire\n", - "- Quantité\n", - "- numero\n", - "- date\n", "- email\n", "- nom\n", - "- prenom" + "- prenom\n", + "- numero\n", + "- date\n", + "- Quantité\n", + "- code\n", + "- prix_unitaire" ], "text/plain": [ "<IPython.core.display.Markdown object>" @@ -216,23 +231,23 @@ { "data": { "text/markdown": [ - "**PRODUIT** (<ins>code</ins>, prix_unitaire) \n", - "- Le champ _code_ constitue la clef primaire de la table. C'était déjà un identifiant de l'entité _PRODUIT_. \n", - "- Le champ _prix_unitaire_ était déjà un simple attribut de l'entité _PRODUIT_. \n", - "\n", - "**Inclut** (<ins>_numero_</ins>, <ins>_code_</ins>, Quantité) \n", - "- Le champ _numero_ fait partie de la clef primaire de la table. C'est une clef étrangère qui a migré directement à partir de l'entité _COMMANDE_. \n", - "- Le champ _code_ fait partie de la clef primaire de la table. C'est une clef étrangère qui a migré directement à partir de l'entité _PRODUIT_. \n", - "- Le champ _Quantité_ était déjà un simple attribut de l'association _Inclut_. \n", + "**CLIENT** (<ins>email</ins>, nom, prenom) \n", + "- Le champ _email_ constitue la clé primaire de la table. C'était déjà un identifiant de l'entité _CLIENT_. \n", + "- Les champs _nom_ et _prenom_ étaient déjà de simples attributs de l'entité _CLIENT_. \n", "\n", - "**COMMANDE** (<ins>numero</ins>, date, _email_) \n", - "- Le champ _numero_ constitue la clef primaire de la table. C'était déjà un identifiant de l'entité _COMMANDE_. \n", + "**COMMANDE** (<ins>numero</ins>, date, _#email_) \n", + "- Le champ _numero_ constitue la clé primaire de la table. C'était déjà un identifiant de l'entité _COMMANDE_. \n", "- Le champ _date_ était déjà un simple attribut de l'entité _COMMANDE_. \n", - "- Le champ _email_ est une clef étrangère. Il a migré à partir de l'entité _CLIENT_ par l'association de dépendance fonctionnelle _Passe_ en perdant son caractère identifiant. \n", + "- Le champ _email_ est une clé étrangère. Il a migré par l'association de dépendance fonctionnelle _Passe_ à partir de l'entité _CLIENT_ en perdant son caractère identifiant. \n", "\n", - "**CLIENT** (<ins>email</ins>, nom, prenom) \n", - "- Le champ _email_ constitue la clef primaire de la table. C'était déjà un identifiant de l'entité _CLIENT_. \n", - "- Les champs _nom_ et _prenom_ étaient déjà de simples attributs de l'entité _CLIENT_." + "**Inclut** (<ins>_#numero_</ins>, <ins>_#code_</ins>, Quantité) \n", + "- Le champ _numero_ fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré directement à partir de l'entité _COMMANDE_. \n", + "- Le champ _code_ fait partie de la clé primaire de la table. C'est une clé étrangère qui a migré directement à partir de l'entité _PRODUIT_. \n", + "- Le champ _Quantité_ était déjà un simple attribut de l'association _Inclut_. \n", + "\n", + "**PRODUIT** (<ins>code</ins>, prix_unitaire) \n", + "- Le champ _code_ constitue la clé primaire de la table. C'était déjà un identifiant de l'entité _PRODUIT_. \n", + "- Le champ _prix_unitaire_ était déjà un simple attribut de l'entité _PRODUIT_." ], "text/plain": [ "<IPython.core.display.Markdown object>" @@ -252,91 +267,90 @@ "cell_type": "code", "execution_count": 4, "id": "2e4b123b-29e2-456b-a7df-8b484397163b", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "data": { "image/svg+xml": [ - "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:link=\"http://www.w3.org/1999/xlink\" width=\"492\" height=\"209\" view_box=\"0 0 492 209\">\n", - "\n", - "<desc>Generated by Mocodo 2.3.9 on Wed, 17 Nov 2021 20:50:42</desc>\n", - "\n", - "<rect id=\"frame\" x=\"0\" y=\"0\" width=\"492\" height=\"209\" fill=\"none\" stroke=\"none\" stroke-width=\"0\"/>\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"492\" height=\"209\" viewBox=\"0 0 492 209\">\n", + "<rect id=\"frame\" x=\"0\" y=\"0\" width=\"492\" height=\"209\" fill=\"#FFF\" stroke=\"none\" stroke-width=\"0\"/>\n", "\n", "<!-- Entity PRODUIT -->\n", - "<g id=\"entity-PRODUIT\">\n", - "\t<g id=\"frame-PRODUIT\">\n", - "\t\t<rect x=\"42\" y=\"18\" width=\"120\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"42\" y=\"44.0\" width=\"120\" height=\"44\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"42\" y=\"18\" width=\"120\" height=\"70\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"42\" y1=\"44\" x2=\"162\" y2=\"44\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"42\" y=\"18\" width=\"120\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"42\" y=\"44\" width=\"120\" height=\"44\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"42\" y=\"18\" width=\"120\" height=\"70\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"42\" y1=\"44\" x2=\"162\" y2=\"44\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"72\" y=\"36.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">PRODUIT</text>\n", - "\t<text x=\"47\" y=\"62.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">code</text>\n", - "\t<line x1=\"47\" y1=\"65.0\" x2=\"82\" y2=\"65.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"47\" y=\"80.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">prix_unitaire</text>\n", + "\t<text x=\"72\" y=\"36.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">PRODUIT</text>\n", + "\t<text x=\"47\" y=\"62.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">code</text>\n", + "\t<line x1=\"47\" y1=\"65\" x2=\"82\" y2=\"65\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"47\" y=\"80.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">prix_unitaire</text>\n", "</g>\n", "\n", "<!-- Entity Inclut -->\n", - "<g id=\"entity-Inclut\">\n", - "\t<g id=\"frame-Inclut\">\n", - "\t\t<rect x=\"228\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"228\" y=\"35.0\" width=\"78\" height=\"62\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"228\" y=\"9\" width=\"78\" height=\"88\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"228\" y1=\"35\" x2=\"306\" y2=\"35\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"228\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"228\" y=\"35\" width=\"78\" height=\"62\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"228\" y=\"9\" width=\"78\" height=\"88\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"228\" y1=\"35\" x2=\"306\" y2=\"35\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"241\" y=\"27.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">Inclut</text>\n", - "\t<text x=\"233\" y=\"53.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">#numero</text>\n", - "\t<line x1=\"233\" y1=\"56.0\" x2=\"293\" y2=\"56.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"233\" y=\"71.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">#code</text>\n", - "\t<line x1=\"233\" y1=\"74.0\" x2=\"276\" y2=\"74.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"233\" y=\"89.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">Quantité</text>\n", + "\t<text x=\"241\" y=\"27.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">Inclut</text>\n", + "\t<text x=\"233\" y=\"53.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">#numero</text>\n", + "\t<line x1=\"233\" y1=\"56\" x2=\"293\" y2=\"56\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"233\" y=\"71.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">#code</text>\n", + "\t<line x1=\"233\" y1=\"74\" x2=\"276\" y2=\"74\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"233\" y=\"89.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">Quantité</text>\n", "</g>\n", "\n", "<!-- Entity COMMANDE -->\n", - "<g id=\"entity-COMMANDE\">\n", - "\t<g id=\"frame-COMMANDE\">\n", - "\t\t<rect x=\"372\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"372\" y=\"35.0\" width=\"78\" height=\"62\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"372\" y=\"9\" width=\"78\" height=\"88\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"372\" y1=\"35\" x2=\"450\" y2=\"35\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"372\" y=\"9\" width=\"78\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"372\" y=\"35\" width=\"78\" height=\"62\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"372\" y=\"9\" width=\"78\" height=\"88\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"372\" y1=\"35\" x2=\"450\" y2=\"35\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"377\" y=\"27.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">COMMANDE</text>\n", - "\t<text x=\"377\" y=\"53.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">numero</text>\n", - "\t<line x1=\"377\" y1=\"56.0\" x2=\"429\" y2=\"56.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"377\" y=\"71.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">date</text>\n", - "\t<text x=\"377\" y=\"89.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">#email</text>\n", + "\t<text x=\"377\" y=\"27.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">COMMANDE</text>\n", + "\t<text x=\"377\" y=\"53.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">numero</text>\n", + "\t<line x1=\"377\" y1=\"56\" x2=\"429\" y2=\"56\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"377\" y=\"71.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">date</text>\n", + "\t<text x=\"377\" y=\"89.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">#email</text>\n", "</g>\n", "\n", "<!-- Entity CLIENT -->\n", - "<g id=\"entity-CLIENT\">\n", - "\t<g id=\"frame-CLIENT\">\n", - "\t\t<rect x=\"71\" y=\"112\" width=\"62\" height=\"26\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"71\" y=\"138.0\" width=\"62\" height=\"62\" fill=\"#FFFFFF\" stroke=\"#FFFFFF\" stroke-width=\"0\"/>\n", - "\t\t<rect x=\"71\" y=\"112\" width=\"62\" height=\"88\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1.5\"/>\n", - "\t\t<line x1=\"71\" y1=\"138\" x2=\"133\" y2=\"138\" stroke=\"#000000\" stroke-width=\"1\"/>\n", + "<g>\n", + "\t<g>\n", + "\t\t<rect x=\"71\" y=\"112\" width=\"62\" height=\"26\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"71\" y=\"138\" width=\"62\" height=\"62\" fill=\"#FFF\" stroke=\"#FFF\" stroke-width=\"0\" opacity=\"1\"/>\n", + "\t\t<rect x=\"71\" y=\"112\" width=\"62\" height=\"88\" fill=\"none\" stroke=\"#000\" stroke-width=\"1.5\" opacity=\"1\"/>\n", + "\t\t<line x1=\"71\" y1=\"138\" x2=\"133\" y2=\"138\" stroke=\"#000\" stroke-width=\"1\"/>\n", "\t</g>\n", - "\t<text x=\"76\" y=\"130.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">CLIENT</text>\n", - "\t<text x=\"76\" y=\"156.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">email</text>\n", - "\t<line x1=\"76\" y1=\"159.0\" x2=\"119\" y2=\"159.0\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "\t<text x=\"76\" y=\"174.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">nom</text>\n", - "\t<text x=\"76\" y=\"192.6\" fill=\"#000000\" font-family=\"Courier New\" font-size=\"14\">prenom</text>\n", + "\t<text x=\"76\" y=\"130.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">CLIENT</text>\n", + "\t<text x=\"76\" y=\"156.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">email</text>\n", + "\t<line x1=\"76\" y1=\"159\" x2=\"119\" y2=\"159\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "\t<text x=\"76\" y=\"174.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">nom</text>\n", + "\t<text x=\"76\" y=\"192.6\" fill=\"#000\" font-family=\"Courier New\" font-size=\"14\">prenom</text>\n", "</g>\n", "\n", - "<!-- Link from \"numero\" (Inclut) to \"numero\" (COMMANDE) -->\n", - "<path d=\"M306 49.0 C 339.0 49.0 328.0 49.0 372 49.0\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<path d=\"M 372 49.0 L 360.0 55.0 L 364.0 49.0 L 360.0 43.0 Z\" fill=\"#000000\" stroke-width=\"0\"/>\n", - "<circle cx=\"306\" cy=\"49.0\" r=\"1.5\" stroke=\"#000000\" stroke-width=\"1.5\" fill=\"#000000\"/>\n", + "<!-- Link from "numero" (Inclut) to "numero" (COMMANDE) -->\n", + "<path d=\"M306 49 C339 49 328 49 372 49\" fill=\"none\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "<polygon points=\"372 49 360 55 364 49 360 43\" fill=\"#000\" stroke-width=\"0\"/>\n", + "<circle cx=\"306\" cy=\"49\" r=\"1.5\" stroke=\"#000\" stroke-width=\"1.5\" fill=\"#000\"/>\n", "\n", - "<!-- Link from \"code\" (Inclut) to \"code\" (PRODUIT) -->\n", - "<path d=\"M228 67.0 C 195.0 62.5 206.0 58.0 162 58.0\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<path d=\"M 162 58.0 L 174.0 52.0 L 170.0 58.0 L 174.0 64.0 Z\" fill=\"#000000\" stroke-width=\"0\"/>\n", - "<circle cx=\"228\" cy=\"67.0\" r=\"1.5\" stroke=\"#000000\" stroke-width=\"1.5\" fill=\"#000000\"/>\n", + "<!-- Link from "code" (Inclut) to "code" (PRODUIT) -->\n", + "<path d=\"M228 67 C195 62.5 206 58 162 58\" fill=\"none\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "<polygon points=\"162 58 174 52 170 58 174 64\" fill=\"#000\" stroke-width=\"0\"/>\n", + "<circle cx=\"228\" cy=\"67\" r=\"1.5\" stroke=\"#000\" stroke-width=\"1.5\" fill=\"#000\"/>\n", "\n", - "<!-- Link from \"email\" (COMMANDE) to \"email\" (CLIENT) -->\n", - "<path d=\"M372 85.0 C 252.5 118.5 292.3333333333333 152.0 133 152.0\" fill=\"none\" stroke=\"#000000\" stroke-width=\"1\"/>\n", - "<path d=\"M 133 152.0 L 145.0 146.0 L 141.0 152.0 L 145.0 158.0 Z\" fill=\"#000000\" stroke-width=\"0\"/>\n", - "<circle cx=\"372\" cy=\"85.0\" r=\"1.5\" stroke=\"#000000\" stroke-width=\"1.5\" fill=\"#000000\"/>\n", + "<!-- Link from "email" (COMMANDE) to "email" (CLIENT) -->\n", + "<path d=\"M372 85 C252.5 118.5 292.33 152 133 152\" fill=\"none\" stroke=\"#000\" stroke-width=\"1\"/>\n", + "<polygon points=\"133 152 145 146 141 152 145 158\" fill=\"#000\" stroke-width=\"0\"/>\n", + "<circle cx=\"372\" cy=\"85\" r=\"1.5\" stroke=\"#000\" stroke-width=\"1.5\" fill=\"#000\"/>\n", "</svg>" ], "text/plain": [ @@ -354,7 +368,9 @@ { "cell_type": "markdown", "id": "685c0300-3bf6-4633-840d-6b068f2619ac", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "Les scripts SQL sont disponibles pour [PostgreSQL](mocodo_notebook/sandbox_postgresql.sql), [MySQL](mocodo_notebook/sandbox_mysql.sql) et [Oracle](mocodo_notebook/sandbox_oracle.sql).." ] @@ -362,7 +378,9 @@ { "cell_type": "markdown", "id": "c4723176-0684-4eec-ba60-d91597046d74", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "### UML\n", "Il est possible de construire simplement des diagrammes (dont UML) en utilisant [PlantUML](https://plantuml.com)." @@ -372,7 +390,9 @@ "cell_type": "code", "execution_count": 5, "id": "d9f7e6ac-7e6e-4870-8bdd-3f9620d6899d", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "import iplantuml" @@ -389,15 +409,15 @@ { "data": { "image/svg+xml": [ - "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" contentScriptType=\"application/ecmascript\" contentStyleType=\"text/css\" height=\"379px\" preserveAspectRatio=\"none\" style=\"width:420px;height:379px;background:#FFFFFF;\" version=\"1.1\" viewBox=\"0 0 420 379\" width=\"420px\" zoomAndPan=\"magnify\"><defs><filter height=\"300%\" id=\"ffz6n8r6r73x1\" width=\"300%\" x=\"-1\" y=\"-1\"><feGaussianBlur result=\"blurOut\" stdDeviation=\"2.0\"/><feColorMatrix in=\"blurOut\" result=\"blurOut2\" type=\"matrix\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0\"/><feOffset dx=\"4.0\" dy=\"4.0\" in=\"blurOut2\" result=\"blurOut3\"/><feBlend in=\"SourceGraphic\" in2=\"blurOut3\" mode=\"normal\"/></filter></defs><g><!--MD5=[67795369a0169a6ec527a79565ea23e1]\n", - "class Commande--><rect codeLine=\"1\" fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"73.6094\" id=\"Commande\" style=\"stroke:#A80036;stroke-width:1.5;\" width=\"120\" x=\"7\" y=\"170\"/><ellipse cx=\"30.1\" cy=\"186\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#A80036;stroke-width:1.0;\"/><path d=\"M33.0688,191.6406 Q32.4906,191.9375 31.85,192.0781 Q31.2094,192.2344 30.5063,192.2344 Q28.0063,192.2344 26.6781,190.5938 Q25.3656,188.9375 25.3656,185.8125 Q25.3656,182.6875 26.6781,181.0313 Q28.0063,179.375 30.5063,179.375 Q31.2094,179.375 31.85,179.5313 Q32.5063,179.6875 33.0688,179.9844 L33.0688,182.7031 Q32.4438,182.125 31.85,181.8594 Q31.2563,181.5781 30.6313,181.5781 Q29.2875,181.5781 28.6,182.6563 Q27.9125,183.7188 27.9125,185.8125 Q27.9125,187.9063 28.6,188.9844 Q29.2875,190.0469 30.6313,190.0469 Q31.2563,190.0469 31.85,189.7813 Q32.4438,189.5 33.0688,188.9219 L33.0688,191.6406 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacing\" textLength=\"70\" x=\"45.9\" y=\"190.1543\">Commande</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"8\" x2=\"126\" y1=\"202\" y2=\"202\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"15\" y=\"210\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"94\" x=\"27\" y=\"216.2104\">numero : Integer</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"15\" y=\"222.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"61\" x=\"27\" y=\"229.0151\">date : Date</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"8\" x2=\"126\" y1=\"235.6094\" y2=\"235.6094\"/><!--MD5=[67e1aed5c2f4d55f1a3a0cfbc189f220]\n", - "class Produit--><rect codeLine=\"5\" fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"73.6094\" id=\"Produit\" style=\"stroke:#A80036;stroke-width:1.5;\" width=\"141\" x=\"265.5\" y=\"170\"/><ellipse cx=\"309.3\" cy=\"186\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#A80036;stroke-width:1.0;\"/><path d=\"M312.2688,191.6406 Q311.6906,191.9375 311.05,192.0781 Q310.4094,192.2344 309.7063,192.2344 Q307.2063,192.2344 305.8781,190.5938 Q304.5656,188.9375 304.5656,185.8125 Q304.5656,182.6875 305.8781,181.0313 Q307.2063,179.375 309.7063,179.375 Q310.4094,179.375 311.05,179.5313 Q311.7063,179.6875 312.2688,179.9844 L312.2688,182.7031 Q311.6438,182.125 311.05,181.8594 Q310.4563,181.5781 309.8313,181.5781 Q308.4875,181.5781 307.8,182.6563 Q307.1125,183.7188 307.1125,185.8125 Q307.1125,187.9063 307.8,188.9844 Q308.4875,190.0469 309.8313,190.0469 Q310.4563,190.0469 311.05,189.7813 Q311.6438,189.5 312.2688,188.9219 L312.2688,191.6406 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacing\" textLength=\"45\" x=\"329.7\" y=\"190.1543\">Produit</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"266.5\" x2=\"405.5\" y1=\"202\" y2=\"202\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"273.5\" y=\"210\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"77\" x=\"285.5\" y=\"216.2104\">code : Integer</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"273.5\" y=\"222.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"115\" x=\"285.5\" y=\"229.0151\">prixUnitaire : Integer</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"266.5\" x2=\"405.5\" y1=\"235.6094\" y2=\"235.6094\"/><!--MD5=[6268cb79eb80437938a1cabad0775594]\n", - "class LigneDeCommande--><rect codeLine=\"9\" fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"60.8047\" id=\"LigneDeCommande\" style=\"stroke:#A80036;stroke-width:1.5;\" width=\"152\" x=\"152\" y=\"305\"/><ellipse cx=\"167\" cy=\"321\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#A80036;stroke-width:1.0;\"/><path d=\"M169.9688,326.6406 Q169.3906,326.9375 168.75,327.0781 Q168.1094,327.2344 167.4063,327.2344 Q164.9063,327.2344 163.5781,325.5938 Q162.2656,323.9375 162.2656,320.8125 Q162.2656,317.6875 163.5781,316.0313 Q164.9063,314.375 167.4063,314.375 Q168.1094,314.375 168.75,314.5313 Q169.4063,314.6875 169.9688,314.9844 L169.9688,317.7031 Q169.3438,317.125 168.75,316.8594 Q168.1563,316.5781 167.5313,316.5781 Q166.1875,316.5781 165.5,317.6563 Q164.8125,318.7188 164.8125,320.8125 Q164.8125,322.9063 165.5,323.9844 Q166.1875,325.0469 167.5313,325.0469 Q168.1563,325.0469 168.75,324.7813 Q169.3438,324.5 169.9688,323.9219 L169.9688,326.6406 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacing\" textLength=\"120\" x=\"181\" y=\"325.1543\">LigneDeCommande</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"153\" x2=\"303\" y1=\"337\" y2=\"337\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"160\" y=\"345\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"96\" x=\"172\" y=\"351.2104\">quantité : Integer</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"153\" x2=\"303\" y1=\"357.8047\" y2=\"357.8047\"/><!--MD5=[ed6624c6556d5e7b1bd23032162d20b7]\n", - "class Client--><rect codeLine=\"13\" fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"86.4141\" id=\"Client\" style=\"stroke:#A80036;stroke-width:1.5;\" width=\"114\" x=\"10\" y=\"7\"/><ellipse cx=\"46.15\" cy=\"23\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke:#A80036;stroke-width:1.0;\"/><path d=\"M49.1188,28.6406 Q48.5406,28.9375 47.9,29.0781 Q47.2594,29.2344 46.5563,29.2344 Q44.0563,29.2344 42.7281,27.5938 Q41.4156,25.9375 41.4156,22.8125 Q41.4156,19.6875 42.7281,18.0313 Q44.0563,16.375 46.5563,16.375 Q47.2594,16.375 47.9,16.5313 Q48.5563,16.6875 49.1188,16.9844 L49.1188,19.7031 Q48.4938,19.125 47.9,18.8594 Q47.3063,18.5781 46.6813,18.5781 Q45.3375,18.5781 44.65,19.6563 Q43.9625,20.7188 43.9625,22.8125 Q43.9625,24.9063 44.65,25.9844 Q45.3375,27.0469 46.6813,27.0469 Q47.3063,27.0469 47.9,26.7813 Q48.4938,26.5 49.1188,25.9219 L49.1188,28.6406 Z \" fill=\"#000000\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacing\" textLength=\"35\" x=\"64.85\" y=\"27.1543\">Client</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"11\" x2=\"123\" y1=\"39\" y2=\"39\"/><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"18\" y=\"47\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"75\" x=\"30\" y=\"53.2104\">email : String</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"18\" y=\"59.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"69\" x=\"30\" y=\"66.0151\">nom : String</text><rect fill=\"none\" height=\"6\" style=\"stroke:#C82930;stroke-width:1.0;\" width=\"6\" x=\"18\" y=\"72.6094\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacing\" textLength=\"88\" x=\"30\" y=\"78.8198\">prenom : String</text><line style=\"stroke:#A80036;stroke-width:1.5;\" x1=\"11\" x2=\"123\" y1=\"85.4141\" y2=\"85.4141\"/><ellipse cx=\"228\" cy=\"207\" fill=\"#000000\" rx=\"2\" ry=\"2\" style=\"stroke:none;stroke-width:1.0;\"/><!--MD5=[5e58994a2f0e32c893f4cb98ec0b91f4]\n", - "link Commande to apoint7--><path d=\"M127.41,207 C167.38,207 214.42,207 225.55,207 \" fill=\"none\" id=\"Commande-apoint7\" style=\"stroke:#A80036;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"62\" x=\"145.5\" y=\"200.0669\">comporte</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"7\" x=\"135.199\" y=\"203.1847\">*</text><!--MD5=[a25ac98b4e49c86dcf5b35d8b1abc2f0]\n", - "link apoint7 to Produit--><path d=\"M230.11,207 C240.09,207 250.07,207 260.05,207 \" fill=\"none\" id=\"apoint7-to-Produit\" style=\"stroke:#A80036;stroke-width:1.0;\"/><polygon fill=\"#A80036\" points=\"265.27,207,256.27,203,260.27,207,256.27,211,265.27,207\" style=\"stroke:#A80036;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"23\" x=\"237.9629\" y=\"201.7777\">1..*</text><!--MD5=[f38a02434c5678a2e9ce26b6952cd29d]\n", - "link apoint7 to LigneDeCommande--><path d=\"M228,209.42 C228,218.65 228,270.78 228,304.76 \" fill=\"none\" id=\"apoint7-LigneDeCommande\" style=\"stroke:#A80036;stroke-width:1.0;stroke-dasharray:7.0,7.0;\"/><!--MD5=[f72067e05319408abc0251939a098f2a]\n", - "link Client to Commande--><path codeLine=\"21\" d=\"M67,93.35 C67,117.29 67,146.89 67,169.75 \" fill=\"none\" id=\"Client-Commande\" style=\"stroke:#A80036;stroke-width:1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"38\" x=\"68\" y=\"136.0669\">passe</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"8\" x=\"58.3625\" y=\"113.4987\">1</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacing\" textLength=\"7\" x=\"59.3766\" y=\"158.8924\">*</text><!--MD5=[03c01ea5f2545a2a8d79bab17a9db863]\n", + "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" contentScriptType=\"application/ecmascript\" contentStyleType=\"text/css\" height=\"377px\" preserveAspectRatio=\"none\" style=\"width:420px;height:377px;\" version=\"1.1\" viewBox=\"0 0 420 377\" width=\"420px\" zoomAndPan=\"magnify\"><defs><filter height=\"300%\" id=\"ffz6n8r6r73x1\" width=\"300%\" x=\"-1\" y=\"-1\"><feGaussianBlur result=\"blurOut\" stdDeviation=\"2.0\"/><feColorMatrix in=\"blurOut\" result=\"blurOut2\" type=\"matrix\" values=\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .4 0\"/><feOffset dx=\"4.0\" dy=\"4.0\" in=\"blurOut2\" result=\"blurOut3\"/><feBlend in=\"SourceGraphic\" in2=\"blurOut3\" mode=\"normal\"/></filter></defs><g><!--MD5=[67795369a0169a6ec527a79565ea23e1]\n", + "class Commande--><rect fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"73.6094\" id=\"Commande\" style=\"stroke: #A80036; stroke-width: 1.5;\" width=\"122\" x=\"6\" y=\"171\"/><ellipse cx=\"30\" cy=\"187\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><path d=\"M32.9688,192.6406 Q32.3906,192.9375 31.75,193.0781 Q31.1094,193.2344 30.4063,193.2344 Q27.9063,193.2344 26.5781,191.5938 Q25.2656,189.9375 25.2656,186.8125 Q25.2656,183.6875 26.5781,182.0313 Q27.9063,180.375 30.4063,180.375 Q31.1094,180.375 31.75,180.5313 Q32.4063,180.6875 32.9688,180.9844 L32.9688,183.7031 Q32.3438,183.125 31.75,182.8594 Q31.1563,182.5781 30.5313,182.5781 Q29.1875,182.5781 28.5,183.6563 Q27.8125,184.7188 27.8125,186.8125 Q27.8125,188.9063 28.5,189.9844 Q29.1875,191.0469 30.5313,191.0469 Q31.1563,191.0469 31.75,190.7813 Q32.3438,190.5 32.9688,189.9219 L32.9688,192.6406 Z \"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"70\" x=\"46\" y=\"191.1543\">Commande</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"7\" x2=\"127\" y1=\"203\" y2=\"203\"/><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"14\" y=\"211\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"96\" x=\"26\" y=\"217.2104\">numero : Integer</text><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"14\" y=\"223.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"63\" x=\"26\" y=\"230.0151\">date : Date</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"7\" x2=\"127\" y1=\"236.6094\" y2=\"236.6094\"/><!--MD5=[67e1aed5c2f4d55f1a3a0cfbc189f220]\n", + "class Produit--><rect fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"73.6094\" id=\"Produit\" style=\"stroke: #A80036; stroke-width: 1.5;\" width=\"143\" x=\"266.5\" y=\"171\"/><ellipse cx=\"311.25\" cy=\"187\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><path d=\"M314.2188,192.6406 Q313.6406,192.9375 313,193.0781 Q312.3594,193.2344 311.6563,193.2344 Q309.1563,193.2344 307.8281,191.5938 Q306.5156,189.9375 306.5156,186.8125 Q306.5156,183.6875 307.8281,182.0313 Q309.1563,180.375 311.6563,180.375 Q312.3594,180.375 313,180.5313 Q313.6563,180.6875 314.2188,180.9844 L314.2188,183.7031 Q313.5938,183.125 313,182.8594 Q312.4063,182.5781 311.7813,182.5781 Q310.4375,182.5781 309.75,183.6563 Q309.0625,184.7188 309.0625,186.8125 Q309.0625,188.9063 309.75,189.9844 Q310.4375,191.0469 311.7813,191.0469 Q312.4063,191.0469 313,190.7813 Q313.5938,190.5 314.2188,189.9219 L314.2188,192.6406 Z \"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"45\" x=\"331.75\" y=\"191.1543\">Produit</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"267.5\" x2=\"408.5\" y1=\"203\" y2=\"203\"/><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"274.5\" y=\"211\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"79\" x=\"286.5\" y=\"217.2104\">code : Integer</text><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"274.5\" y=\"223.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"117\" x=\"286.5\" y=\"230.0151\">prixUnitaire : Integer</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"267.5\" x2=\"408.5\" y1=\"236.6094\" y2=\"236.6094\"/><!--MD5=[6268cb79eb80437938a1cabad0775594]\n", + "class LigneDeCommande--><rect fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"60.8047\" id=\"LigneDeCommande\" style=\"stroke: #A80036; stroke-width: 1.5;\" width=\"152\" x=\"153\" y=\"306\"/><ellipse cx=\"168\" cy=\"322\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><path d=\"M170.9688,327.6406 Q170.3906,327.9375 169.75,328.0781 Q169.1094,328.2344 168.4063,328.2344 Q165.9063,328.2344 164.5781,326.5938 Q163.2656,324.9375 163.2656,321.8125 Q163.2656,318.6875 164.5781,317.0313 Q165.9063,315.375 168.4063,315.375 Q169.1094,315.375 169.75,315.5313 Q170.4063,315.6875 170.9688,315.9844 L170.9688,318.7031 Q170.3438,318.125 169.75,317.8594 Q169.1563,317.5781 168.5313,317.5781 Q167.1875,317.5781 166.5,318.6563 Q165.8125,319.7188 165.8125,321.8125 Q165.8125,323.9063 166.5,324.9844 Q167.1875,326.0469 168.5313,326.0469 Q169.1563,326.0469 169.75,325.7813 Q170.3438,325.5 170.9688,324.9219 L170.9688,327.6406 Z \"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"120\" x=\"182\" y=\"326.1543\">LigneDeCommande</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"154\" x2=\"304\" y1=\"338\" y2=\"338\"/><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"161\" y=\"346\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"98\" x=\"173\" y=\"352.2104\">quantité : Integer</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"154\" x2=\"304\" y1=\"358.8047\" y2=\"358.8047\"/><!--MD5=[ed6624c6556d5e7b1bd23032162d20b7]\n", + "class Client--><rect fill=\"#FEFECE\" filter=\"url(#ffz6n8r6r73x1)\" height=\"86.4141\" id=\"Client\" style=\"stroke: #A80036; stroke-width: 1.5;\" width=\"116\" x=\"9\" y=\"8\"/><ellipse cx=\"46.05\" cy=\"24\" fill=\"#ADD1B2\" rx=\"11\" ry=\"11\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><path d=\"M49.0188,29.6406 Q48.4406,29.9375 47.8,30.0781 Q47.1594,30.2344 46.4563,30.2344 Q43.9563,30.2344 42.6281,28.5938 Q41.3156,26.9375 41.3156,23.8125 Q41.3156,20.6875 42.6281,19.0313 Q43.9563,17.375 46.4563,17.375 Q47.1594,17.375 47.8,17.5313 Q48.4563,17.6875 49.0188,17.9844 L49.0188,20.7031 Q48.3938,20.125 47.8,19.8594 Q47.2063,19.5781 46.5813,19.5781 Q45.2375,19.5781 44.55,20.6563 Q43.8625,21.7188 43.8625,23.8125 Q43.8625,25.9063 44.55,26.9844 Q45.2375,28.0469 46.5813,28.0469 Q47.2063,28.0469 47.8,27.7813 Q48.3938,27.5 49.0188,26.9219 L49.0188,29.6406 Z \"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"12\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"35\" x=\"64.95\" y=\"28.1543\">Client</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"10\" x2=\"124\" y1=\"40\" y2=\"40\"/><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"17\" y=\"48\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"77\" x=\"29\" y=\"54.2104\">email : String</text><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"17\" y=\"60.8047\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"71\" x=\"29\" y=\"67.0151\">nom : String</text><rect fill=\"none\" height=\"6\" style=\"stroke: #C82930; stroke-width: 1.0;\" width=\"6\" x=\"17\" y=\"73.6094\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"11\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"90\" x=\"29\" y=\"79.8198\">prenom : String</text><line style=\"stroke: #A80036; stroke-width: 1.5;\" x1=\"10\" x2=\"124\" y1=\"86.4141\" y2=\"86.4141\"/><ellipse cx=\"229\" cy=\"208\" fill=\"#000000\" rx=\"2\" ry=\"2\" style=\"stroke: none; stroke-width: 1.0;\"/><!--MD5=[5e58994a2f0e32c893f4cb98ec0b91f4]\n", + "link Commande to apoint7--><path d=\"M128.25,208 C168.39,208 215.42,208 226.55,208 \" fill=\"none\" id=\"Commande-apoint7\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"62\" x=\"146.5\" y=\"201.0669\">comporte</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"7\" x=\"136.1414\" y=\"204.1847\">*</text><!--MD5=[a25ac98b4e49c86dcf5b35d8b1abc2f0]\n", + "link apoint7 to Produit--><path d=\"M231.13,208 C241.08,208 251.04,208 260.99,208 \" fill=\"none\" id=\"apoint7->Produit\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><polygon fill=\"#A80036\" points=\"266.2,208,257.2,204,261.2,208,257.2,212,266.2,208\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"23\" x=\"238.956\" y=\"202.8554\">1..*</text><!--MD5=[f38a02434c5678a2e9ce26b6952cd29d]\n", + "link apoint7 to LigneDeCommande--><path d=\"M229,210.42 C229,219.65 229,271.78 229,305.76 \" fill=\"none\" id=\"apoint7-LigneDeCommande\" style=\"stroke: #A80036; stroke-width: 1.0; stroke-dasharray: 7.0,7.0;\"/><!--MD5=[f72067e05319408abc0251939a098f2a]\n", + "link Client to Commande--><path d=\"M67,94.35 C67,118.29 67,147.89 67,170.75 \" fill=\"none\" id=\"Client-Commande\" style=\"stroke: #A80036; stroke-width: 1.0;\"/><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"38\" x=\"68\" y=\"137.0669\">passe</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"8\" x=\"58.3625\" y=\"114.4987\">1</text><text fill=\"#000000\" font-family=\"sans-serif\" font-size=\"13\" lengthAdjust=\"spacingAndGlyphs\" textLength=\"7\" x=\"59.3766\" y=\"159.8924\">*</text><!--MD5=[5398dd5b79d4f9869b9bc902df30d147]\n", "@startuml\n", "class Commande { \n", " - numero : Integer\n", @@ -422,10 +442,12 @@ "Client \"1\" - - \"*\" Commande : passe\n", "@enduml\n", "\n", - "PlantUML version 1.2021.12(Tue Oct 05 16:01:58 UTC 2021)\n", + "PlantUML version 1.2020.02(Sun Mar 01 10:22:07 UTC 2020)\n", "(GPL source distribution)\n", "Java Runtime: OpenJDK Runtime Environment\n", "JVM: OpenJDK 64-Bit Server VM\n", + "Java Version: 11.0.18+10-post-Ubuntu-0ubuntu122.04\n", + "Operating System: Linux\n", "Default Encoding: UTF-8\n", "Language: en\n", "Country: US\n", @@ -470,7 +492,9 @@ { "cell_type": "markdown", "id": "8faa6c8f-3be8-4fa4-9675-c3f2f354adfb", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "## Initialisation connection SGBD\n", "L'intégration de SQL est faite avec [ipython-sql](https://github.com/catherinedevlin/ipython-sql).\n", @@ -494,7 +518,9 @@ { "cell_type": "markdown", "id": "5427ddce-56ea-461b-ac29-e4864b97ce8b", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "Le lancement du serveur PostgreSQL et création d'une base de données est automatique avant le lancement. La base de données est stockée physiqment dans le répertoire 'work/pgdata/DEMO_DB'.\n", "\n", @@ -505,7 +531,9 @@ "cell_type": "code", "execution_count": 8, "id": "cfbca6ff-1393-43da-aa4c-16869fa6f8e0", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [], "source": [ "%sql postgresql://localhost/jovyandb" @@ -514,7 +542,9 @@ { "cell_type": "markdown", "id": "497856bb-827f-4b5c-9479-7a76b1fb4919", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "## Utilisation de SQL\n", "L'utilisation SQL peut se faire dans une cellule en le préfixant de %%sql" @@ -524,7 +554,9 @@ "cell_type": "code", "execution_count": 9, "id": "2c918a0c-5a0f-4db0-b76a-6ae37d13589a", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -596,7 +628,9 @@ "cell_type": "code", "execution_count": 10, "id": "e3b35f69-a5eb-4888-b518-84f3a0841fba", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -628,9 +662,11 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 13, "id": "9232e8ad-c21e-4bf1-b92d-30be7ec5d94a", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -644,30 +680,34 @@ "data": { "text/html": [ "<table>\n", - " <tr>\n", - " <th>id_client</th>\n", - " <th>email</th>\n", - " <th>nom</th>\n", - " <th>prenom</th>\n", - " </tr>\n", - " <tr>\n", - " <td>1</td>\n", - " <td>a.b@x.fr</td>\n", - " <td>a</td>\n", - " <td>b</td>\n", - " </tr>\n", - " <tr>\n", - " <td>2</td>\n", - " <td>c.d@x.fr</td>\n", - " <td>c</td>\n", - " <td>d</td>\n", - " </tr>\n", - " <tr>\n", - " <td>3</td>\n", - " <td>e.f@x.fr</td>\n", - " <td>e</td>\n", - " <td>f</td>\n", - " </tr>\n", + " <thead>\n", + " <tr>\n", + " <th>id_client</th>\n", + " <th>email</th>\n", + " <th>nom</th>\n", + " <th>prenom</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <td>1</td>\n", + " <td>a.b@x.fr</td>\n", + " <td>a</td>\n", + " <td>b</td>\n", + " </tr>\n", + " <tr>\n", + " <td>2</td>\n", + " <td>c.d@x.fr</td>\n", + " <td>c</td>\n", + " <td>d</td>\n", + " </tr>\n", + " <tr>\n", + " <td>3</td>\n", + " <td>e.f@x.fr</td>\n", + " <td>e</td>\n", + " <td>f</td>\n", + " </tr>\n", + " </tbody>\n", "</table>" ], "text/plain": [ @@ -676,7 +716,7 @@ " (3, 'e.f@x.fr', 'e', 'f')]" ] }, - "execution_count": 11, + "execution_count": 13, "metadata": {}, "output_type": "execute_result" } @@ -689,34 +729,39 @@ { "cell_type": "markdown", "id": "e9130678-99f7-42c0-a474-aabfbfc8f355", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "Les résultats des requêtes peuvent être affecté dans des variables python et traitée sous forme de dataframes avec la librairie Panda." ] }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 14, "id": "c0e8873f-6c46-455d-829d-d042770d9e08", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " * postgresql://localhost/jovyandb\n", - "3 rows affected.\n", - "<class 'pandas.core.frame.DataFrame'>\n", - "RangeIndex: 3 entries, 0 to 2\n", - "Data columns (total 4 columns):\n", - " # Column Non-Null Count Dtype \n", - "--- ------ -------------- ----- \n", - " 0 id_client 3 non-null int64 \n", - " 1 email 3 non-null object\n", - " 2 nom 3 non-null object\n", - " 3 prenom 3 non-null object\n", - "dtypes: int64(1), object(3)\n", - "memory usage: 224.0+ bytes\n" + "3 rows affected.\n" + ] + }, + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'pandas'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[14], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m clients \u001b[38;5;241m=\u001b[39m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msql\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124m SELECT * FROM CLIENT\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m \u001b[43mclients\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDataFrame\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\u001b[38;5;241m.\u001b[39minfo()\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/sql/run.py:168\u001b[0m, in \u001b[0;36mResultSet.DataFrame\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 166\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mDataFrame\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 167\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Returns a Pandas DataFrame instance built from the result set.\"\"\"\u001b[39;00m\n\u001b[0;32m--> 168\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[1;32m 170\u001b[0m frame \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame(\u001b[38;5;28mself\u001b[39m, columns\u001b[38;5;241m=\u001b[39m(\u001b[38;5;28mself\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkeys) \u001b[38;5;129;01mor\u001b[39;00m [])\n\u001b[1;32m 171\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m frame\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pandas'" ] } ], @@ -727,9 +772,11 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 15, "id": "cc525ac0-15e4-4ef8-a16b-cad00ce948e3", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -747,7 +794,7 @@ "[]" ] }, - "execution_count": 13, + "execution_count": 15, "metadata": {}, "output_type": "execute_result" } @@ -761,9 +808,11 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 16, "id": "2ba87c2d-65bf-45f9-a71c-1130c11c7e2b", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -777,33 +826,37 @@ "data": { "text/html": [ "<table>\n", - " <tr>\n", - " <th>code_produit</th>\n", - " <th>description</th>\n", - " <th>prix_unitaire</th>\n", - " </tr>\n", - " <tr>\n", - " <td>1</td>\n", - " <td>pomme</td>\n", - " <td>2</td>\n", - " </tr>\n", - " <tr>\n", - " <td>2</td>\n", - " <td>peche</td>\n", - " <td>4</td>\n", - " </tr>\n", - " <tr>\n", - " <td>3</td>\n", - " <td>poire</td>\n", - " <td>3</td>\n", - " </tr>\n", + " <thead>\n", + " <tr>\n", + " <th>code_produit</th>\n", + " <th>description</th>\n", + " <th>prix_unitaire</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <td>1</td>\n", + " <td>pomme</td>\n", + " <td>2</td>\n", + " </tr>\n", + " <tr>\n", + " <td>2</td>\n", + " <td>peche</td>\n", + " <td>4</td>\n", + " </tr>\n", + " <tr>\n", + " <td>3</td>\n", + " <td>poire</td>\n", + " <td>3</td>\n", + " </tr>\n", + " </tbody>\n", "</table>" ], "text/plain": [ "[(1, 'pomme', 2), (2, 'peche', 4), (3, 'poire', 3)]" ] }, - "execution_count": 14, + "execution_count": 16, "metadata": {}, "output_type": "execute_result" } @@ -815,9 +868,11 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 17, "id": "e68b5145-ea69-4574-ac1c-6f1c67de5567", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -836,16 +891,20 @@ { "cell_type": "markdown", "id": "2b458632-71cf-4872-ba51-b226bedfe637", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "Il est aussi possible d'utiliser des variables python comme paramètres des requêtes." ] }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 18, "id": "ea570c9b-8b52-4099-b5ac-fd14e880def0", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -862,33 +921,37 @@ "data": { "text/html": [ "<table>\n", - " <tr>\n", - " <th>numero_commande</th>\n", - " <th>code_produit</th>\n", - " <th>quantite</th>\n", - " </tr>\n", - " <tr>\n", - " <td>1</td>\n", - " <td>1</td>\n", - " <td>5</td>\n", - " </tr>\n", - " <tr>\n", - " <td>1</td>\n", - " <td>2</td>\n", - " <td>2</td>\n", - " </tr>\n", - " <tr>\n", - " <td>1</td>\n", - " <td>3</td>\n", - " <td>1</td>\n", - " </tr>\n", + " <thead>\n", + " <tr>\n", + " <th>numero_commande</th>\n", + " <th>code_produit</th>\n", + " <th>quantite</th>\n", + " </tr>\n", + " </thead>\n", + " <tbody>\n", + " <tr>\n", + " <td>1</td>\n", + " <td>1</td>\n", + " <td>5</td>\n", + " </tr>\n", + " <tr>\n", + " <td>1</td>\n", + " <td>2</td>\n", + " <td>2</td>\n", + " </tr>\n", + " <tr>\n", + " <td>1</td>\n", + " <td>3</td>\n", + " <td>1</td>\n", + " </tr>\n", + " </tbody>\n", "</table>" ], "text/plain": [ "[(1, 1, 5), (1, 2, 2), (1, 3, 1)]" ] }, - "execution_count": 16, + "execution_count": 18, "metadata": {}, "output_type": "execute_result" } @@ -905,16 +968,20 @@ { "cell_type": "markdown", "id": "a5f348ed-9b42-430d-afde-ae138eb03712", - "metadata": {}, + "metadata": { + "user_expressions": [] + }, "source": [ "Et donc de les afficher très simple y compris sous forme graphique." ] }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 19, "id": "96f25786-c320-49ff-8345-88edd2f827ec", - "metadata": {}, + "metadata": { + "tags": [] + }, "outputs": [ { "name": "stdout", @@ -925,26 +992,16 @@ ] }, { - "data": { - "text/plain": [ - "<AxesSubplot:xlabel='description'>" - ] - }, - "execution_count": 17, - "metadata": {}, - "output_type": "execute_result" - }, - { - "data": { - "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEGCAYAAAB1iW6ZAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXRElEQVR4nO3df5BV5Z3n8fdHaIVEJlakNxIabJM4BjSIpsXwIxY6xviDVWdDVs0YRXfTJWVGk52YUnfDJFQmZWo2kxSS2EPUUjIZNWJMsQaTyNYwikG0wQaVFkNmerUXKrYYG1hEBb/7xz1Nrpd7u89tbnfTD59X1ak+P577nC+c6g+Hc895jiICMzMb/o4Y6gLMzKw2HOhmZolwoJuZJcKBbmaWCAe6mVkiRg7VjseOHRuNjY1DtXszs2Fp3bp1r0VEfbltQxbojY2NtLa2DtXuzcyGJUn/p9I2X3IxM0uEA93MLBEOdDOzRAzZNXQzOzS98847dHZ2smfPnqEu5bA2atQoGhoaqKury/0ZB7qZvUdnZydjxoyhsbERSUNdzmEpIti+fTudnZ2ccMIJuT/nSy5m9h579uzh2GOPdZgPIUkce+yxVf8vKXegSxoh6VlJj5TZJkmLJG2RtFHS6VVVYWaHFIf50OvPMajmDP1GoL3CtguAE7OpGbij6krMzOyg5LqGLqkBuAj4O+C/lWlyCbA0CoOrPyXpGEnjImJb7Uo1s6HQePMva9pfx20X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kYg4ZahrsYPjY5kOH8t8fIZuZpYIn6GbmSXCZ+hmZolwoJuZJcKBbmaWCAe6DUuSvinpawPU90JJ5/bR5lIVjeaX5zNmA81PipoVUWE0vgU5ml4KPAJsAsj5GbMB5TN0GzYk/XdJmyWtBE7K1n1U0q+yEQ+fkPTxbP3nJT2fjZz4eLZuhKT/mY3Mt1HSX2frOyQtkLQa+LykeyTNLdr23Wx0vqezERlnABcDf5+N2PfRks/0NjLnt1QYyfG5nlrNasWBbsOCpE8ClwOnAf8JOCPbtAT464j4JPA1CqPnASwAPhsRp1IIX4Bm4ATgtIiYAvy0aBd7ImJWRNxfZvc7ImIasJjCyJi/pTAg200RMTUifl9U5yjgHuCyiPgEhf8Fzy/q67WIOB24I6vXrGYc6DZcfBp4OCJ2Z+OuLKcwxO0MCo9+twH/yJ8e434SuEfSlyiMhAiF0SxbImIvQES8XtT/A73s+76in30NxnUSB44AeFbR9p9nP9dRGLXRrGZ8Dd2Gk9Kn4I4A3oiIqQc0jLhO0pnARUBbNtCZyvTR4//l3G9fT+Kpj+09Izf2jNpoVjM+Q7fh4nHgLyWNzsYu/4/AbuDfJX0eQAWnZvMfjYi12ZeVrwETKIxmeZ2kkVmbD+bc92VFP9dk8zspvMik1IsMzsicZgdwoNuwEBHrKVwWaaPwsoInsk1/BfyXbMTDF4BLsvV/n33x+DyFfww2AHcCLwMbs/ZfyLn7o7LXl90IfDVbdz9wU/blZ8+r6npejDEYI3OaHcBjuZj1QlIHhVeZvTbUtZj1xWfoZmaJ8Bm6mVkifIZuZpYIB7qZWSIc6GZmiXCgm5klwoFuZpaI/w8RlS651eWWiwAAAABJRU5ErkJggg==\n", - "text/plain": [ - "<Figure size 432x288 with 1 Axes>" - ] - }, - "metadata": { - "needs_background": "light" - }, - "output_type": "display_data" + "ename": "ModuleNotFoundError", + "evalue": "No module named 'pandas'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "Cell \u001b[0;32mIn[19], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m result \u001b[38;5;241m=\u001b[39m get_ipython()\u001b[38;5;241m.\u001b[39mrun_line_magic(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124msql\u001b[39m\u001b[38;5;124m'\u001b[39m, \u001b[38;5;124m'\u001b[39m\u001b[38;5;124mselect * from PRODUIT;\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[0;32m----> 2\u001b[0m produits_dataframe \u001b[38;5;241m=\u001b[39m \u001b[43mresult\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mDataFrame\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 3\u001b[0m produits_dataframe\u001b[38;5;241m.\u001b[39mset_index(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mdescription\u001b[39m\u001b[38;5;124m'\u001b[39m)[[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mprix_unitaire\u001b[39m\u001b[38;5;124m\"\u001b[39m]]\u001b[38;5;241m.\u001b[39mplot\u001b[38;5;241m.\u001b[39mbar(rot\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m)\n", + "File \u001b[0;32m/opt/conda/lib/python3.10/site-packages/sql/run.py:168\u001b[0m, in \u001b[0;36mResultSet.DataFrame\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 166\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mDataFrame\u001b[39m(\u001b[38;5;28mself\u001b[39m):\n\u001b[1;32m 167\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Returns a Pandas DataFrame instance built from the result set.\"\"\"\u001b[39;00m\n\u001b[0;32m--> 168\u001b[0m \u001b[38;5;28;01mimport\u001b[39;00m \u001b[38;5;21;01mpandas\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m \u001b[38;5;21;01mpd\u001b[39;00m\n\u001b[1;32m 170\u001b[0m frame \u001b[38;5;241m=\u001b[39m pd\u001b[38;5;241m.\u001b[39mDataFrame(\u001b[38;5;28mself\u001b[39m, columns\u001b[38;5;241m=\u001b[39m(\u001b[38;5;28mself\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mkeys) \u001b[38;5;129;01mor\u001b[39;00m [])\n\u001b[1;32m 171\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m frame\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'pandas'" + ] } ], "source": [ @@ -952,13 +1009,21 @@ "produits_dataframe = result.DataFrame()\n", "produits_dataframe.set_index('description')[[\"prix_unitaire\"]].plot.bar(rot=0)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "dfd88623-cc20-45f1-86a9-4f6294bfafcb", + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { "kernelspec": { - "display_name": "Python [conda env:root] *", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "conda-root-py" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -970,7 +1035,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.7" + "version": "3.10.10" } }, "nbformat": 4, diff --git a/run-with-docker.sh b/run-with-docker.sh index 349ad1e8ced4b7ec0fbcc0733f3ea799a9159548..3b517e6050639889655f871f89a3e0518cd2e689 100755 --- a/run-with-docker.sh +++ b/run-with-docker.sh @@ -1,7 +1,19 @@ +#!/usr/bin/env bash + +WORK_DIR="${HOME}/JUPYTER_WORK_DIR" + +IMAGE_REPO=brunoe +IMAGE_NAME=jupyter-db-pg +IMAGE_TAG=develop + + docker run --rm \ - --name JupyterJava-${PWD##*/} \ - --volume $PWD:/home/jovyan/${PWD##*/} \ - --publish 8888:8888 \ - --env NB_UID=$UID \ - --env JUPYTER_ENABLE_LAB=yes \ - brunoe/jupyterdb:develop + --name ${IMAGE_NAME}-${PWD##*/} \ + --user root \ + --volume ${PWD}:/home/jovyan/notebooks/ \ + --volume ${WORK_DIR}:/home/jovyan/works/ \ + --publish 8888:8888 \ + --env NB_UID=$UID \ + ${IMAGE_REPO}/${IMAGE_NAME}:${IMAGE_TAG} \ + start-notebook.sh --notebook-dir=/home/jovyan/notebooks/ +