Syntactic Confectionery Delight | |
PerlMonks |
Re^5: inserting a column into mySQL DB with perlby NetWallah (Canon) |
on Jan 22, 2016 at 03:57 UTC ( [id://1153343]=note: print w/replies, xml ) | Need Help?? |
It looks like you want to get the hang of many-to-many relationships. This would occur, if , in your example, the same model CAR was available in many "Sizes" - i.e. perhaps Compact, Sedan, and hatchback. Now, if you wanted to keep the database "normalized" - i.e. have no duplicate primary data, you would set up CARS and SIZES as you started with, and add a table, say "MODEL", which contained a carID and a SizeID, and perhaps a date-introduced. Now, for each car, say MiniCooper, you add a record in "MODEL" for each size it offers. Actually creating a database would make this more clear.
Anyway - all this stuff is old-school "relational" database" modelling. "I can cast out either one of your demons, but not both of them." -- the XORcist
In Section
Seekers of Perl Wisdom
|
|