You are on page 1of 2

a) Based on the ERD prepared above, design a set of relational tables to store the data


b) Describe the relationship between the entities in the ERD above

i) One to many relationship (1: M), one record in a table can be associated with one or more
records in another table. For the entities in the ERD above:

 Customer to Invoice: Each customer can have many sales invoice and the primary key field in
the Customers table is customer ID which contain unique values.

 Invoice to Product line: Each invoice number comes with many product lines. The primary
key field for invoice is order number ID and the foreign key in the invoice will be customer ID
which has provides the most linked data between two tables. The primary key for product
line will be Product line ID because it will never change and unique and foreign key field is
order number ID.

 Salesman to product line: Each salesman will record many product lines based on customer
order. Therefore, the primary key field for salesman is salesman ID because it will never
change and special. The primary key for Product line will Product linen ID and the foreign key
field is salesman ID as every product line will be refer to salesman ID

ii) Many to one relationship (M: 1), one record in a table can be associated with one or more
records in another table. For the entities in the ERD above:

 Invoice to Salesman: Invoice receives from customer comes with one salesman. Therefore,
primary key field for invoice is order number ID and primary key field for salesman will be
salesman ID. The foreign key field for salesman will be order number ID as it has the most
linked data between invoice and salesman

 Salesman to Branch: Many salesmen will be placed for every branch. The primary key field
will be salesman ID and branch name. The foreign key field will be salesman ID as will be the
most linked and referral data.

 Product line to Product: For every product line purchase by customer will lead to one
product only. Therefore, the primary key field will be product line ID and product ID. The
foreign key field will be product line ID because it has the most linked data between both of
them.

You might also like