sqliterelationshiptable-relationships

Difference between One-Mnay relationship & Many-Many relationship


I am just confused about One-One relationship and Many-Many relationship. Well if I have a users table and a course table, Do I have to add a third table to make it Many-Many relationship or I can just connect them with foreign keys and primary keys? I hope my question is clear to you.


Solution

  • One-to-Many example :-

    enter image description here

    Many to One example :-

    enter image description here