This set entered on 5-12-2014
5.1.14.2
They HAVE SOMETHING IN COMMON. For example, the INVOICE TABLE and the LINE ITEM TABLE both have an INVOICE NUMBER FIELD.
INVOICES and LINE ITEMS have a ONE TO MANY RELATIONSHIP. A LINE ITEM belongs to ONE INVOICE, but ONE INVOICE can have many LINE ITEMS.
To ensure consistency, you are basically using the TABLE AS A VALUE LIST. With a JOB TABLE, instead of typing the job name everywhere, you simply choose it from a list.
An INVOICE IS PAID WITH PAYMENTS, AND A PAYMENT IS APPLIED TO INVOICES. An iNVOICE can be paid with several payments and a payment can be applied to multiple invoices. THEREFORE, MANY TO MANY.
You need to chop it in half, turning each HALF into a separate ONE TO MANY RELATIONSHIP.
You have to add a new SPECIAL PURPOSE ENTITY in the middle, so the INVOICES TABLE has a ONE TO MANY RELATIONSHIP with the SPECIAL ENTITY, and the PAYMENTS TABLE has a ONE TO MANY RELATIONSHIP with the SPECIAL ENTITY.
its database name is JOIN TABLE, but you should give it a descriptive name TO FIT THE SITUATION: call it INVOICE PAYMENTS.
a. an INVOICE is paid with INVOICE PAYMENTS, and an INVOICE PAYMENT is applied to ONE INVOICE.
b. A PAYMENT is divided into INVOICE PAYMENTS, and an INVOICE PAYMENT is part of one payment.