Answer the question
In order to leave comments, you need to log in
Have I designed the tables in the database correctly?
Briefly about the essence: there is such a concept in the domain logic as the arrival of money. The arrival can be of different types. Depending on the type, you need to specify additional. fields when adding an arrival and save them. I decided to create a separate table in the database for each type and connect it to the main income table through a 1:1 relationship.
This is how my tables look like
a table of receipts money_coming
with fields
-id
-amount
-type_id
-date_added
client_moneycoming
with fields-id
-money_coming_id
-client_id
-order_code
Answer the question
In order to leave comments, you need to log in
In practice, no one creates tables with 1:1 relationships. There are, of course, exceptional cases. They are related to bypassing the restrictions on the use of BLOB fields and other things, but this is definitely not your case.
You can safely combine two plates into one and everything will be fine. If you didn't make a mistake with the normalization.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question