SQL: Multiple Foreign Keys for Inheritance -


i have few tables in database , have quick question regarding foreign keys.

tables

company

pk: companyid 

manufacturer

pk, fk: companyid 

make/model

pk: makemodelid fk: manufacturerid 

equipment

pk: equipmentid fk: makemodelid 

would proper include manufacturerid column fk manufacturer in equipment table? , smart create index on both manufacturerid , makemodelid in equipment table? i'm self taught , seeking design input. thanks.

no, not proper include fk manufacturer table in equipment table.

the equipment table has fk make/model table has fk manufacturer table. if created fk, technically record in equipment table linked 2 different manufacturers.


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -