I'm building a personal real-estate site to track property expenses and calculate returns. Currently I have a single expenses table that tracks expenses for both properties and for individual units (a unit is related to a property). My expense table looks like this:
| expense_id | property_id | unit_id | amount | date |
| ---------- | ----------- | ------- | ------ | -----|
I have both property_id and unit_id set to allow nulls, there should only be values for either property or unit, but never both. IS this properly normalized or does it make sense to create two separate tables one for property_expenses and one for unit_expenses?