Bird
0
0

Which Prisma schema field type is used to define a relation to another model?

easy📝 Conceptual Q2 of 15
NestJS - Database with Prisma
Which Prisma schema field type is used to define a relation to another model?
AString
BRelation field with model type
CInt
DBoolean
Step-by-Step Solution
Solution:
  1. Step 1: Identify relation field type

    In Prisma, relations are defined by fields typed as another model, not primitive types like String or Int.
  2. Step 2: Relation field usage

    These fields link models together and Prisma uses them to generate foreign keys and queries.
  3. Final Answer:

    Relation field with model type -> Option B
  4. Quick Check:

    Relation fields use model types, not primitives [OK]
Quick Trick: Relation fields use model types, not primitives [OK]
Common Mistakes:
  • Using primitive types for relations
  • Confusing relation fields with scalar fields
  • Forgetting to specify the related model type

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes