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

php - get table cell data from and place a copy in another table -

javascript - Mootools wait with Fx.Morph start -

php - Navigate throught databse rows -