To create a good database, I have to know the relationship between tables.
It is clear, the database I talking about is relationship database.
There are three types of table relationships.
- One-to-one relationships
- One-to-many relationships
- Many-to-many relationships
In a one-to-one relationship, a key will appear only once in a related table. It is the most simply relation.
In a one-to-many relationship, keys from one table will appear multiple times in a related table.
The exapmle is a connection between department and employees. One department has many employees. One employee can only be in one department.
It is a very common type of relationship.