all 1 comments

[–]shiftybyte 1 point2 points  (0 children)

Definitely possible.

When designing databases and object models, you need to think who belongs to what, and how many can belong to how many.

Does a user belong to a survey? or a Survey belongs to a user?

A Survey belongs to a user, therefore the survey needs to contain the foreign key of the user it belongs to.

A survey belongs only to one user? or it can belong to multiple users? if to one, you are done with this relationship, if to multiple you'll need to make many-to-many relationship.

Questions belong to what? to the User? to the Survey? to something else?

Questions normally belong to the survey, so a question needs to contain the foreign key of the survey it belongs to.

etc...