i have many tables : customers, prospects, friends..
They all have some Notes.
Question 1:
Should i have one Notes Table shared with all the parent Tables.
OR
Should i have a NotesCustomer, NotesProspects, NotesFriends Tables ?
Question 2:
If the best solution is the first one then this general Notes table should then have a FK to the parent table but ALSO the type of the parent table ?
I'm using EntityFramework but this question is also general i guess...
Thanks Jon
The first option, a distinct Notes table for Prospects, Customers, and Friends, is likely a cleaner solution.
If you use a general notes table, you will need to have three nullable FK columns to determine which related table the FK belongs to, with only one of them populated in each row.
Generally speaking, the goal of a good relational model is NOT (or not necessarily) to store like data together, but to only store specific data once. So a good question to ask yourself when designing this would be "what am I gaining by storing all notes in the same table?"
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