One to many relation

Basic database relations:

One to many relation definition:

Relation one to many exist when one value from the example database entitiy (table) can be assigned to many values from the other entitiy (table) in this database.

One to many relation example:

Let’s take some example of shop database which contains 2 entities: Sellers (Sellers table presents data about shop sales staff) and Products (this table shows data about products that our shop is currently selling and sellers assigned to these products).

We suppose also that one seller is responsible for selling more than one product and selling this product by other seller is forbidden.

One to many relation

As we can see in the above picture, between Sellers and Products table exist one to many relation because to one seller (for example: Susan Smith) can be assigned more than one (many, as in the example with Susan Smith: Microwaves and Food processors) products (one seller is responsible for many products).

One to many relation

Copyright © 2015-2016 • All Rights Reserved •