This question applies to any database table design where you will have system default elements and user default settings of the same type (i.e. the user can add his own elements / settings).
Here is an example of billing and payment types. By default, the invoice may have payment conditions DueOnReceipt, NET10, NET15, NET30 (this is the default value for all users!), So you will have two tables "INVOICE" and "PAYMENT_TERM" "
INVOICE
Id
...
PaymentTermId
PAYMENT_TERM (System default)
Id
Name
Now, what is the best way to let the user store their own "PaymentTerms" and why? (i.e. the user can use the default payment terms for the system or the custom user payment terms that he created / added)
Option 1) Add the UserId to PaymentTerm, set the userid for the user who added the user element and the system default user identifier to null.
INVOICE
Id
...
PaymentTermId
PaymentTerm
Id
Name
UserId (System Default, UserId=null)
Option 2) Add a flag to the invoice "IsPaymentTermCustom" and create a custom table "PAYMENT_TERM_CUSTOM"
INVOICE
Id
...
PaymentTermId
PaymentTermCustomId
IsPaymentTermCustom (True for custom, otherwise false for system default)
PaymentTerm
Id
Name
PAYMENT_TERM_CUSTOM
Id
Name
UserId
Now check with the SQL query if the user uses a custom payment term or not, if IsPaymentTermCustom = True, this means that the user uses a custom payment term, otherwise its value is false.
Option 3)
...