Info
Open the page on your phone

Database Relationships

There are three main types of relationships between tables:

  • One-to-one. This type of relationship means that each instance of one table corresponds to only one instance of another table. For example, a customer table may have a one-to-one relationship with an order table, where each customer corresponds to only one order.
  • One-to-many. This type of relationship means that one instance of one table can correspond to multiple instances of another table. For example, a product table may have a one-to-many relationship with an order table, where one product can be ordered multiple times.
  • Many-to-many. This type of relationship means that multiple instances of one table can correspond to multiple instances of another table. For example, an author table may have a many-to-many relationship with a book table, where one author can write multiple books and one book can be written by multiple authors.