u/Charlton_Chestwig

Foreign Key Problem (Base)

I am a complete beginner with databases, so there is probably a simple explanation, but I can't find it.

I am trying to build a database that will eventually generate tags for PLC and SCADA from the P&ID device list. I have ceated 3 tables, first for the P&ID devices, which uses the P&ID tag as the primary key (all unique) and has a column of device types (text)

The second table contains all the boolean tag suffixes, per device type, so device type is a primary key, same field details as in the P&ID table.

The third table is a repeat of the second, but for real tag suffixes (device type is a primary key)

I can create a 1:n relationship between the PID Tag table and the Boolean table but when I try to add a second 1:n between the PID Tags and the Real Tags I get this error (screenshot)

How do I resolve this? I can't find any way to add a foreign key (whatever that is) to a table?

Eventually I want to have tables for Integer tags as well

reddit.com
u/Charlton_Chestwig — 10 days ago