In which table will be foreign key if the relation in two tables is many to one i.e. from 1st table (many ) to second table(one)
In which table will be foreign key if the relation in two tables is many to one i.e. from 1st table (man开发者_如何学编程y ) to second table(one).
The 1st table. What do I win??!
The foreign key will be in the first table i.e. your many table.
Foreign keys are in tables that reference other tables, so in your case it will be in "many"-table. Don't be fooled by cardinality - there can be foreign key defined in 1:1 relationship.
精彩评论