I have two tables
recipe table
-----------------------
|recipe_id |name |
-----------------------
|1 |Pasta |
|2 |Pizza |
|3 |Fish |
ingredient table
-------------------------------
|ingredient_id |name |
-------------------------------
|1 |Spaghetti |
|2 |Salmon |
|3 |Tomato sauce|
I created a junction table called "recipes_ingredients"
-------------------------------
|id |fk_recipe|fk_ingredient|
-------------------------------
|1 |1 |1 |
|2 |2 |3 |
|3 |3 |2 |
My first question is: is it correct how I created the "recipes_ingredients" table? Do I need the "id" or I can just have the two foreign keys "fk_recipe" and "fk_ingredient"?
And the second one is if it's possible to autopopulate the junction table when I insert a record in the other two tables. Or do I have to add manually every single association in the junction table?