sql - Creating a Composite Foreign key, based on the SAME primary key in another table -
first of all, i'm not sure worded title correctly, let me explain in detail i'm trying do.
i'm trying link 2 tables (outfits , items) in sql server; primary keys outfit_id , item_id(an auto incrementing int) respectively.
an outfit made of combination of items; therefore want primary key (outfits_id) (item_id,item_id,item_id) or how many ever items takes make outfit.
is possible, , if how go it?
for composite key, need table outfit_item , have outfit_id , item_id. can add many records each. outfit 1 can have multiple items , 1 item can have multiple outfits. can restrict these using relationships.
Comments
Post a Comment