In a very simple application, it is possible to have a single table. However, as the complexity of the application grows and the need to store data increases, the number of tables also increases. If we are trying to store a complex related set of data, then these tables will also relate to each other using foreign keys. To model our database correctly and have a properly normalized database, we will end up with a set of related tables. Let's look at the various types of relationship that can exist between tables in a database.
There are three types of relationship that can exist between tables:
One-to-many relationship
One-to-one relationship
Many-to-many relationship
Let's try to understand these relationships from a real-world perspective. We will then see how these relationships are realized in the database.