I need some help please. Party is the supertype to person, dealer and customer. I am having a difficult time modelling the customer and dealer tables.
This system can have many dealers and a dealer can have many customers. What I need is for every dealer to keep a sequential list of its customer numbers. Sample data might look like this.
Code:
dealer_id customer_id
1 1
1 2
1 3
2 1
2 2
2 3
Since a subtype cannot contain any other PK other than the PK from the supertype I thought about adding attributes such as customer_id in the customer table and dealer_id in the dealer table and making them alternate keys. I could then link to the dealer_customer table using the AKs.
I tried this but it does not give me my sample data above because the db is enforcing the constraint on the customer_id by not allowing me to duplicate.
Is there another way to do this?
Thanks.
Frank