I've never used IP addresses in a database so this has me puzzled. I've done a lot of research and it seems there's many different ways to store IP addresses. Some actually store it as decimal, some as binary. I think my database project is not that large or complicated of a project, so I am planning on just storing IP addresses as text (i.e. 192.168.1.1/24) and require that data be entered in that format before it will write to the table.
So then, I have a table which stores information about equipment. Then, I have to decide if I want to add 3-4 fields to the equipment table for IP addresses, OR if I want to create another table just for IP addresses and create a one to one relationship between tblEquipment and tblIPAddresses. That is, the PK in tblIPAddresses will be a number (not autonumber) of the FK from tblEquipment.
In my mind, the reason for me doing this is because an IP address will only ever belong to one piece of equipment at a time. And, it is unique (there will never be duplicates).
But then I wonder, if i'm using a one to one relationship... should I just put it all in the equipment table? I don't like doing that, because if I think about it, that might make it harder for me to unassign an IP address from one equipment, and assign it to another piece of equipment.
So then, I have a table which stores information about equipment. Then, I have to decide if I want to add 3-4 fields to the equipment table for IP addresses, OR if I want to create another table just for IP addresses and create a one to one relationship between tblEquipment and tblIPAddresses. That is, the PK in tblIPAddresses will be a number (not autonumber) of the FK from tblEquipment.
In my mind, the reason for me doing this is because an IP address will only ever belong to one piece of equipment at a time. And, it is unique (there will never be duplicates).
But then I wonder, if i'm using a one to one relationship... should I just put it all in the equipment table? I don't like doing that, because if I think about it, that might make it harder for me to unassign an IP address from one equipment, and assign it to another piece of equipment.
Comment