← All tutorials
Skill Zuno · skillzunos.com · Python Data Science
SQLAlchemy tutorial
Learn SQLAlchemy on Skill Zuno. This SQLAlchemy tutorial covers New, Easy, Medium, Hard, and Diff levels so you can study practical SQLAlchemy problems on skillzunos.com.
Open SQLAlchemy on Skill ZunoAlso see the SQLAlchemy interview questions.
SQLAlchemy is the most widely used Python toolkit for working with relational databases. Its Core layer builds SQL expressions in Python, and its ORM maps Python classes to tables with sessions, relationships and unit-of-work persistence. Interviews cover engines and connections, declarative models, the Session, querying with select(), relationship loading strategies, transactions and migrations with Alembic.
SQLAlchemy topics covered
- Engines and connections — Creating an engine, database URLs and connection pooling.
- Core versus ORM — Building SQL with tables and expressions, or working with mapped classes.
- Declarative models — Defining tables with DeclarativeBase, Mapped and mapped_column.
- Sessions and transactions — The unit of work, add, commit, rollback and session lifecycles.
- Querying and relationships — select(), joins, relationships and loading with selectinload and joinedload.
- Migrations and async — Schema changes with Alembic, and AsyncSession with async drivers.
What you can learn
- SQLAlchemy tutorial for beginners and experienced developers
- Level-based practice: New, Easy, Medium, Hard, and Diff
- Python Data Science topics alongside SQLAlchemy on skillzunos.com