I'm using MySQL and my tables are stored using innoDB for the purpose of referential integrity.
QUESTION
I'm building a sales order system.
My invoice
table has tracking_code
column and COD_place
column
Customer deals with me using either one of these methods: shipping or COD (cash on delivery/meeting him up personally). Each parcel that is shipped has a tracking code, while for COD, there has to be a place to do that. Thus the column
tracking_code
andCOD_place
.
The problem is, if shipping is preferred, then the COD_place
column should be NULL or left empty; otherwise, tracking_code
must be NULL.
It's not elegant. What is the best way to represent this? Can you create a generalized entity, method
in MySQL?
I really can't think of any elegant solution so I turned to your help here. Thank you in advance!