ik heb een eindproduct (bedframe) dat te verkrijgen is in verschillende uitvoeringen (in totaal 12 uitvoeringen). (Nu doe ik dat vanuit een xls file). Ik heb de onderdelen (parts) die gebruikt worden om het eindproduct te maken. Niet elk eindproduct heeft dezelfde parts, noch in aantal parts in dat eindproduct zijn dezelfde. En de eindbedoeling is dan ook een voorraad bij te houden die dan wordt aangepast na of bij elke productie.
ik vroeg raad op een Engelse site, kreeg antwoord, maar raakte er niet wijs uit. Waar ik struikel is het begrip primery key, foreign key.
Ik kreeg bv dit antwoord:
partsID should be _*pk*_bedframeID. Next step would be to create a foreign key in the import table _*fk*_bedframeID and give all the records you imported for that bedframe that *pk*.
Repeat this with all your xls files – Import, create a bedframe file and give the freshly imported records that *pk as fk*. This connects the imported parts to that bedframe, and eventually, each join table record to exactly one bedframe record.
You don't change the part name in the import table, because this is the join table; the final goal is to have a parts represented by its fk, which refers to a Parts pk in the Parts table. To make that happen, you'll have to create the parts in their own table by a script that removes duplicates (based on the name), creates unique part records and writes back their *pk*s as *fk*s (again, based on the name).
Kan iemand, met de gegevens hierboven, een aanzet geven via een voorbeeld? Dat zou fantastisch zijn!
Vraag
iMac1943
ik heb een eindproduct (bedframe) dat te verkrijgen is in verschillende uitvoeringen (in totaal 12 uitvoeringen). (Nu doe ik dat vanuit een xls file). Ik heb de onderdelen (parts) die gebruikt worden om het eindproduct te maken. Niet elk eindproduct heeft dezelfde parts, noch in aantal parts in dat eindproduct zijn dezelfde. En de eindbedoeling is dan ook een voorraad bij te houden die dan wordt aangepast na of bij elke productie.
ik vroeg raad op een Engelse site, kreeg antwoord, maar raakte er niet wijs uit. Waar ik struikel is het begrip primery key, foreign key.
Ik kreeg bv dit antwoord:
partsID should be _*pk*_bedframeID. Next step would be to create a foreign key in the import table _*fk*_bedframeID and give all the records you imported for that bedframe that *pk*.
Repeat this with all your xls files – Import, create a bedframe file and give the freshly imported records that *pk as fk*. This connects the imported parts to that bedframe, and eventually, each join table record to exactly one bedframe record.
You don't change the part name in the import table, because this is the join table; the final goal is to have a parts represented by its fk, which refers to a Parts pk in the Parts table. To make that happen, you'll have to create the parts in their own table by a script that removes duplicates (based on the name), creates unique part records and writes back their *pk*s as *fk*s (again, based on the name).
Kan iemand, met de gegevens hierboven, een aanzet geven via een voorbeeld? Dat zou fantastisch zijn!
Link naar reactie
32 antwoorden op deze vraag
Aanbevolen berichten
Doe mee aan dit gesprek
Je kunt dit nu plaatsen en later registreren. Indien je reeds een account hebt, log dan nu in om het bericht te plaatsen met je account.