Your comments

as a many-to-many relationship we need to define both foreign keys as main key...how we do that?
if we create another table it creates its own key..

why in one-to-one relationship we need to add the foreign key as constrain?