SQLAlchemy ORM (Models, Relationships, Aggregates) - Python Tutorial for Beginners #36
11views
0016:47
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Learn SQLAlchemy ORM! In this tutorial, you will learn how to map Python classes to database tables, create relationships between models, and build a full project
tracker application.
What you will learn:
- Creating a database engine with create_engine()
- Defining models with DeclarativeBase and Column types
- Creating and managing sessions with sessionmaker
- Adding, querying, updating, and deleting records
- Using filter_by() and filter() for queries
- Defining one-to-many relationships with ForeignKey
- Navigating relationships with back_populates
- Seeding data through relationship assignment
- Using session.get() for primary key lookups
- Aggregate queries with func.count() and func.sum()
- Joining tables with .join() and .group_by()
- Wrapping ORM operations in reusable functions
Timestamps:
0:00 - Introduction
0:33 - ORM Basics Explained
1:00 - ORM Basics Demo
4:48 - ORM Relationships Explained
5:15 - ORM Relationships Demo
9:30 - Project Tracker Explained
9:57 - Project Tracker Demo
15:11 - Recap
15:51 - End
Source code: https://github.com/GoCelesteAI/python_sqlalchemy_orm
Previous: Lesson 35 - SQLite Part 2
https://youtu.be/PLACEHOLDER_L35
Next: Lesson 37 - CLI Applications
Coming soon!
---
Python Tutorial for Beginners playlist - Learn Python from scratch with hands-on coding demos.
#Python #SQLAlchemy #ORM #PythonTutorial #LearnPython #PythonForBeginners #CodingTutorial #Database #Models #Relationships
Back to tutorialsOpen in YouTube
Duration
16:47
Published
February 12, 2026
Added to Codegiz
March 15, 2026