codejump

Queries, Updates & Transactions

Preview — 3 of 10 questions

A list endpoint needs only active Hero rows. Which SQLModel query shape applies the filter in the database?

Aselect(Hero).where(Hero.active == True)
Bselect(Hero) followed by a response-model flag
Csession.refresh(Hero.active)
DHero.model_dump(exclude_unset=True)

A list endpoint uses select(Hero).offset(20).limit(10). What is the intent?

AReturn rows with ID exactly 20
BSkip 20 matching rows and return at most 10
CUpdate 20 rows then delete 10
DCreate ten database tables

A PATCH body omits name but includes age=0. Which dump preserves the omitted name while including zero?

Apatch.model_dump(exclude_none=True) only
Bpatch.model_dump() with all defaults
Cpatch.model_dump(exclude_unset=True)
Dsession.refresh(patch)

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.