Relationship

One-to-one relationship

  • Table A and B is in one to one relationship ,actually the column of table A and B can be combined into one table, since product feature is optional, so we can separate into 2 tables.

One-to-many relationship

  • Table A and B is one-to-many relationship, table A is one , table B is many, as we see that different rows of table B can have the same foreign key referencing to table A.

Many-to-many relationship

  • Table A and C is many-to-many relationship, same product can exist in different places and same place can contain different products, we cannot directly link table A and C directly, we need to setup a bridge which is table B. Table A and table B is one-to-many relationship. Table C and B is also a one-to-many relationship.

Last updated

Was this helpful?