I'm looking at this data model I've come up with and not feeling comfortable. I've changed the entity names so it (hopefully) makes more sense. In any event, how would you model the following?
I have 3 entities. GovernmentCustomer, PrivateCustomer, PublicCustomer. Private and Public Customer are both CorporateCustomers. Corporate and Government Customers are Accounts. All Accounts share the same key space (So if PrivateCustomer has a PK of 1 it shouldn't be possible for Public or GovernmentCustomer to have a PK of 1). CorporateCustomers have some 1:M relationships that GovernmentCustomer's don't. PublicCustomers have some 1:M relationships that PrivateCustomers don't.
The Inheritance:
Account
CorporateCustomer
PrivateCustomer
PublicCustomer
GovernmentCustomer
Right now my model has 5 tables. The "Account" table being the root of this hierarchy with each child table's PK being a FK to its parent's PK. So all the tables have the same PK.
So yeah, how would you model this? I hope something hasn't gone wildly wrong here :).
EDIT:
Also: - I'd like the DB to be taking care of ref integrity not the app. - Its not possible for a CorporateCustomer to exist without being either a Private Or Public customer. Its abstract.