codejump

Models & CRUD Basics — Series 2

Preview — 3 of 10 questions

Which SQLModel field setting identifies a row's primary key?

AField(primary_key=True)
BField(response_model=True)
CField(route=True)
DField(cookie=True)

Why is a new row's id often typed int | None with default None?

AFastAPI requires every ID to stay null forever
BThe database can generate it when the row is inserted
CThe row is never stored
DThe ID comes from the response header

A GET collection handler runs select(Hero).limit(5). What does the limit do?

ADelete five rows
BRequire exactly five rows to exist
CReturn at most five matching rows
DChange the route's HTTP status

Sign up free to play

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