Relating to different tables based on choice

Hello.

I building a database where I need to store information about customers.
One of the fields is the customers access type. I have 3 options, they can have static IP, DHCP or PPPoP access.
Each of the access types have their own table where the information about them is stored.
Now I want to be able to chose one and store the information about it, and relate it to the customer in the best way. I don’t want to store DHCP information for a customer that has static IP access and so on. (If I’m unclear on what I want to achieve please ask me to elaborate)

Anyone got any ideas on how to accomplish this in the best way?

Br.

use a foreign key in the customers table that references a common accesstypes table

then make the three different access tables subtype tables for the supertype accesstypes table

for more info, search supertype/subtype

Thanks a mill, appreciate it :slight_smile:

As I didn’t have time to try out the solution posted at the time i read it I hastily assumed it would work. But as I started reading up on it I realized that mysql does not support inheritance. Or am I mistaken?
Is there a workaround to mimic this functionality in mysql? or do I have to use a completely different method?

Br.

did you do the search i suggested? which of the search results did you not like?