codejump

Queries, Updates & Transactions — Series 3

Preview — 3 of 10 questions

A FastAPI PATCH body sets name to its current value and omits age. What does exclude_unset=True include?

AThe explicitly sent name, but not age
BNeither field because name did not change
CAge with its default value only
DEvery table column

A PATCH body explicitly sends a field with its model default value. Which dump option preserves that supplied field for the update?

Aexclude_defaults=True, because it preserves every explicit default
Bexclude_unset=True, because it tracks supplied fields
Cexclude_none=True, because it tracks every supplied field
DNo dump option can preserve a default value

A list handler paginates with offset and limit but no order_by. What is the correctness concern?

ALimit cannot work without a response model
BOffset deletes earlier rows
CPage membership is not predictably ordered
DSQLModel automatically orders by name

Sign up free to play

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