In relational database design, a relationship is where two or more tables are linked together because they contain related data. This enables users to run queries for related data across multiple tables.
Relationships are a key element in relational database design.
Here’s an example:
In the above example, the City table has a relationship with the Customer table. Each customer is assigned a city. This is done by using a CityId field in the Customer table that matches a CityId in the City table.
While it’s certainly possible to store the full city name in the Customer table, it’s better to have a separate table that stores the city details. You can easily use a query to look up the CityName by using the CityId that’s stored for that customer.