From 455c43ccdbf1a4c4daa0c594a1de95eb9e9668c6 Mon Sep 17 00:00:00 2001 From: Stephan Kulla Date: Mon, 13 Nov 2023 10:41:34 +0100 Subject: [PATCH] Update src/2023/2023-11-09-inconsitencies-in-the-database.ipynb --- ...2023-11-09-inconsitencies-in-the-database.ipynb | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/2023/2023-11-09-inconsitencies-in-the-database.ipynb b/src/2023/2023-11-09-inconsitencies-in-the-database.ipynb index b78fe4b..0313877 100644 --- a/src/2023/2023-11-09-inconsitencies-in-the-database.ipynb +++ b/src/2023/2023-11-09-inconsitencies-in-the-database.ipynb @@ -20,9 +20,7 @@ "from sqlalchemy import create_engine\n", "from sqlalchemy import text\n", "\n", - "engine_local = create_engine(\n", - " f\"mysql+mysqlconnector://root:secret@localhost:3306/serlo?charset=latin1\"\n", - ")\n", + "engine_local = create_engine(\"mysql+mysqlconnector://root:secret@localhost:3306/serlo\")\n", "\n", "class MySQLSession:\n", " def __init__(self, engine):\n", @@ -59,7 +57,7 @@ }, { "cell_type": "code", - "execution_count": 44, + "execution_count": 7, "id": "352dd822-e5ff-4ae5-aeb3-072023a67243", "metadata": {}, "outputs": [ @@ -874,7 +872,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 8, "id": "243bb95c-7bff-427f-9886-49779ef7e80a", "metadata": {}, "outputs": [ @@ -956,7 +954,7 @@ " left join entity_link on entity_link.child_id = entity.id\n", " where\n", " type.name in (\"grouped-text-exercise\", \"text-solution\", \"course-page\")\n", - " and entity_link.child_id is null\n", + " and entity_link.parent_id is null\n", " group by type.name, uuid.trashed\n", " \"\"\", session.connection))" ] @@ -971,7 +969,7 @@ }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 9, "id": "c54060cc-d636-454f-951e-c5f431f41e76", "metadata": {}, "outputs": [ @@ -1346,7 +1344,7 @@ " left join entity_link on entity_link.child_id = entity.id\n", " where\n", " type.name in (\"grouped-text-exercise\", \"text-solution\", \"course-page\")\n", - " and entity_link.child_id is null\n", + " and entity_link.parent_id is null\n", " group by entity.id\n", " limit 20\n", " \"\"\", session.connection))"