Composite key as foreign key of multiple tables

database-designerd

enter image description here

On Entity1 table, could I merge the two "a" field in a single field ?

Best Answer

It depends on the data model.

If it is possible and correct for a row in table 1 to have a relationship with rows in tables 2 & 3 with different values of a then you must keep the two values separate as you potentially need to different values.

If this should not be possible (i.e. makes no sense for the situation you are modelling) then not only could you use the same column, but you should as keeping two copies of data that should be identical can lead, via bugs or other human error, to consistency errors. The same column can participate in any number of keys and indexes so that will not block you from doing this.

Without more information on what you are modelling, it is not possible to give a more definite answer.