http://www.perlmonks.org?node_id=1064283


in reply to Re^2: Storing multiple value field in a MySQL database
in thread Storing multiple value field in a MySQL database

Of course you can create one VARCHAR(512), or whatever field, cram a bunch of comma-separated-values into it, and parse them out later. You can do that. But that's not an effective use of your database. It prevents you from easily searching in-database for all users who are a member of "wizzards". Instead you will have to use "LIKE" clauses, which are less efficient, or slurp all records into your script and do your own processing.

SQL-style databases usually just use another table whenever a developer is tempted to cram more than one item into a given field. There's good reason for that.


Dave

  • Comment on Re^3: Storing multiple value field in a MySQL database