i have two tables:
1) Users
2) Scenarios
Relation between them can be described as:
User can have 0 or more Scenarios
Scenario must be associated with exactly one User
One way is to create User_Scenario_rels and use ID from users and scenarios table to create relationships. But is this the best practice? Is this 1 to many relationship?
This is a “one to many” relationship – one scenary has one user, one user has many scenarios.
It’s commonly modeled by a “user_id” column on the scenario table.
In terms of database design as practised in the field, there’s no distinction between “a user has 0 or more scenarios” and “a user has 1 or more scenarios”; in theory, if you wanted to impose the rule that all users MUST have at least 1 scenario, you would implement a constraint.