Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^5: inserting a column into mySQL DB with perl

by NetWallah (Canon)
on Jan 22, 2016 at 03:57 UTC ( [id://1153343]=note: print w/replies, xml ) Need Help??


in reply to Re^4: inserting a column into mySQL DB with perl
in thread inserting a column into mySQL DB with perl

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.
"NOSQL" databases are in fashion now, and these store key-value pairs. However, it does help to understand the old structured databases, even if you use one of these new-fangled things(My favourite is ElasticSearch).

        "I can cast out either one of your demons, but not both of them." -- the XORcist

  • Comment on Re^5: inserting a column into mySQL DB with perl

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1153343]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2024-04-19 11:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found