Skip to content

Commit

Permalink
feat (sql): new question in Receitas
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Sep 16, 2023
1 parent f5f46c0 commit 7b292bd
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 18 deletions.
63 changes: 56 additions & 7 deletions sql/receitas/exercicios/s01-receitas-basico.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "33001cae-013a-4621-a524-de0fb9696a39",
"model_id": "04a4f6ac-0881-406a-b7fd-751a82972481",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -53,7 +53,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "11ec9ee4-43f0-46b5-8c0d-0604be2e034b",
"model_id": "6538e4f3-cfb2-4c84-a9c3-a73ed13f1ef5",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -65,7 +65,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "42ba6e15-8096-4981-ac19-4f9054fda733",
"model_id": "224b215c-c4f0-4f80-b913-86b28e908a13",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -141,9 +141,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "6c3fdc2e-ac0f-4f7c-88e0-f2cc44969ab0",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": []
},
{
Expand All @@ -157,9 +170,22 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9be6584d-32da-4d9d-be58-556e98b3598d",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": []
},
{
Expand Down Expand Up @@ -265,6 +291,29 @@
"Apresente aquelas receitas em que o valor da coluna `custo_total` não corresponde ao custo calculado."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Bloco de Questões sobre JOIN Explícito"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Questão 2b\n",
"\n",
"Considerando a questão 2: liste o nome de todas as receitas e o nome dos ingredientes das receitas. Modifique-a de modo a apresentá-la com JOIN Explícito."
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down
62 changes: 51 additions & 11 deletions sql/receitas/resolucao/s01-receitas-basico.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "34b50e70-b3e5-4fe1-9c35-e0841dc51ee4",
"model_id": "690357b3-8c49-49b6-a7ee-c271d8d03a5c",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -53,7 +53,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1bcfbff3-9bea-4986-9c80-79066236064f",
"model_id": "70970a4c-30e7-4a66-8690-140efdc35ab5",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -65,7 +65,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d6ab6e1f-ccf7-41c4-b864-99c3166a6034",
"model_id": "9f4b56f9-98dd-4edb-a20a-d0a2779386b5",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -147,7 +147,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "e54eaa74-f500-4c60-8ef0-1bcc98ad16fd",
"model_id": "e00ed3f1-cfa2-4d5a-a8f9-e5fdfa3e1f0c",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -179,7 +179,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "fe189db5-7752-42e7-beeb-de16b860b9cf",
"model_id": "9e265046-04bc-45b4-8199-2fa022967655",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -243,7 +243,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "80d40075-3a73-4e66-ae76-bb153dbbe246",
"model_id": "737be214-89d2-4d5e-95fa-66c7267e2bf0",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -275,7 +275,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4e69349c-9b07-49bf-96ee-a84ebdd343f6",
"model_id": "00775962-604d-4f8d-b3a2-7a4d1d690dd7",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -312,7 +312,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4d9b3a5f-0d53-4c3f-80aa-50237895c384",
"model_id": "fd2595d1-4069-4898-963f-4a2d1eb182e4",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -346,7 +346,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "4c7ca6e3-765a-47a3-88bd-290e1a7ec652",
"model_id": "d7898d31-26b3-4454-ae72-2bfa2e5cb86a",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -377,7 +377,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d115a37e-863e-46ec-92c3-995d47780122",
"model_id": "e8928197-cb7f-4961-93a0-326bebcf00ab",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -411,7 +411,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3899fae3-bd12-4342-b918-28891326c1ad",
"model_id": "7f70573c-9e7b-4648-ab75-8760fb0edbec",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -428,6 +428,46 @@
"GROUP BY I.CODIGO_RECEITA\n",
"HAVING R.CUSTO_TOTAL <> CUSTO_CALCULADO;"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Bloco de Questões sobre JOIN Explícito"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Questão 2b\n",
"\n",
"Considerando a questão 2: liste o nome de todas as receitas e o nome dos ingredientes das receitas. Modifique-a de modo a apresentá-la com JOIN Explícito."
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "b76103c7-010c-4319-9505-220d0fbbb721",
"version_major": 2,
"version_minor": 0
},
"method": "display_data"
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"SELECT R.NOME_RECEITA, P.NOME_PRODUTO\n",
"FROM Receita R JOIN Ingrediente I ON R.CODIGO_RECEITA = I.CODIGO_RECEITA\n",
" JOIN Produto P ON I.CODIGO_PRODUTO = P.CODIGO_PRODUTO;"
]
}
],
"metadata": {
Expand Down

0 comments on commit 7b292bd

Please sign in to comment.