What is one to many relationship in database?

By Arsal Ahmed   Posted on March-20-2018 

What is one to many relationship in database?

The One-to-Many relationship is defined as a relationship between two tables where a row from one table can have multiple matching rows in another table. This relationship can be created using Primary key-Foreign key relationship.

In a one-to-many relationship, one record in a table can be associated with one or more records in another table. For example, each customer can have many sales orders.

A one-to-many relationship looks like this in the relationships graph:

Customers table and orders table with a one to many relationship line between them

In this example the primary key field in the Customers table, Customer ID, is designed to contain unique values. The foreign key field in the Orders table, Customer ID, is designed to allow multiple instances of the same value.

The One-to-Many relationship is defined as a relationship between two tables where a row from one table can have multiple matching rows in another table. This relationship can be created using Primary key-Foreign key relationship.

In a one-to-many relationship, one record in a table can be associated with one or more records in another table. For example, each customer can have many sales orders.

A one-to-many relationship looks like this in the relationships graph:

Customers table and orders table with a one to many relationship line between them

In this example the primary key field in the Customers table, Customer ID, is designed to contain unique values. The foreign key field in the Orders table, Customer ID, is designed to allow multiple instances of the same value.

By Arsal Ahmed    20-Mar-2018 



You may also read following recent articles