English
Summary
Conclusions
Keys and constraints protect data structure; parameters separate values from SQL; a transaction groups related changes. SQLAlchemy provides typed models and a unit of work but requires explicit session management and knowledge of the queries being executed.
Self-check questions
- How do primary and foreign keys differ?
- How do you implement M:N with an additional grade?
- What guarantees does a STRICT table add?
- When must foreign_keys be enabled in SQLite?
- Why can a parameter not replace a column name?
- How does LEFT JOIN differ from INNER JOIN?
- What is the difference between WHERE and HAVING?
- What does COUNT return for missing right-hand rows?
- Why does with connection not replace close?
- What state remains after rolling back an import?
- How does Core differ from ORM?
- What do flush and commit do in a Session?
- What does a detached object mean?
- How does selectinload affect the N+1 problem?
- Why is create_all not a migration?