Bird
0
0

In a NestJS TypeORM ManyToMany relation between Teacher and Classroom, which statement about the join table is correct?

medium📝 component behavior Q5 of 15
NestJS - Database with TypeORM
In a NestJS TypeORM ManyToMany relation between Teacher and Classroom, which statement about the join table is correct?
AThe join table stores foreign keys referencing both Teacher and Classroom entities
BThe join table stores only the primary key of Teacher
CThe join table is optional and not created by default
DThe join table stores entity data instead of keys
Step-by-Step Solution
Solution:
  1. Step 1: Understand ManyToMany join tables

    ManyToMany relations require a join table to link the two entities.
  2. Step 2: Join table contents

    The join table contains foreign keys referencing the primary keys of both related entities.
  3. Final Answer:

    The join table stores foreign keys referencing both Teacher and Classroom entities -> Option A
  4. Quick Check:

    Join table holds foreign keys for both sides [OK]
Quick Trick: Join table holds foreign keys of both entities [OK]
Common Mistakes:
  • Thinking join table stores full entity data
  • Assuming join table is optional
  • Believing join table stores only one side's key

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More NestJS Quizzes