Types of relationships in databases can be divided into three categories: one-to-one, one-to-many, and many-to-many
A one-to-one relationship (1:1) specifies the characteristics of an entity. For example, each book has a title and a price.
A one-to-many relationship (1:n) is usually defined as a foreign key, for example a book can have several pages and each page belongs to a book.
The many-to-many (n:n) relationship, which is usually implemented by creating a separate table that has two or more foreign keys, is such that one record from one table can refer to several records from another table, and every The record from the second table can also refer to several records from the first table.
For example, each book can have n authors and each author can write m books.