I would like to know what the rule of thumb is regarding sub tables in a relational DB?
For example.
In the picture below i have replaced a few fields with sub-tables, because there can me multiple, but limited, instances of each
Is this overkill or the preferred way of DB design?
Second normal form (2NF) further addresses the concept of removing duplicative data:
Meet all the requirements of the first normal form.
Remove subsets of data that apply to multiple rows of a table and place them in separate tables.
Create relationships between these new tables and their predecessors through the use of foreign keys.
P.S. I know a uuid is not a INT and will change it.
If there will be more than one instance of the same data in the same table, there should be a relationship formed. Duplicate data is difficult to manage and you leave a lot of room for bugs.
As long as you don't have 2 references of the same data in one table, you're safe.
Database normalization is the process of organizing the fields and tables of a relational database to minimize redundancy.
See: Database normalization
You're on the right track.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With