r/learndatascience • • 4d ago

Resources Learning SQL with Python?

Post image

This 👉interactive SQLite demonstration helps student understand relational databases.

The sqlite3 extension of 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 makes database content visible alongside Python's data structures. The demo shows how to:

  • Create tables with primary and foreign keys.
  • Model relationships between students, courses, and teachers.
  • Insert data and observe how the database changes.
  • Combine multiple tables using SQL JOIN operations.
  • Use parameterized queries.

The final query answers a seemingly simple question: Which teachers teach Alice, and for which courses? Answering this question involves joining five tables!

With 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡, students can step through the Python program and inspect the database content at every step, directly in their browser, without installing anything.

See 👉other 𝐦𝐞𝐦𝐨𝐫𝐲_𝐠𝐫𝐚𝐩𝐡 visualization.

81 Upvotes

4 comments sorted by

1

u/ownroot 3d ago

Why not with SQL?

1

u/Sea-Ad7805 3d ago

It uses SQL silly.

3

u/Darknessgg 4d ago

Thanks

1

u/Kotaiche_Konda93 2d ago

joining five tables just to connect students to teachers is usually when junction tables finally start making sense