Answer the question
In order to leave comments, you need to log in
How to properly store data that may or may not be a separate table or nullable fields in a row?
There is an order. The client can select the "delivery" checkbox and then select the delivery city from the list and enter the address manually. In theory, you need to make a separate table with the order id, city id and address fields, right?
But in order not to fuss with unnecessary requests or joins, it’s easier for me to prescribe nullable fields in the order itself and not hover. Does this solution have obvious disadvantages? Does it break normalization?
Answer the question
In order to leave comments, you need to log in
If there is a boolean type field other than city and address, then it seems to formally degrade normalization. Also, this will indeed be the case when multiple orders / products, i.e. rows, it is possible to have one common delivery.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question