0

I'd like some guidance in a "best method"-approach for a new table. I've got a website with several tables. I'm now building a "lists"-section so members can build lists with various items.

For the lists-table I have some general info (title, description, .. very basic) For the list-items I've got 2 key fields: type and ID. The type determines the table to get the info from and ID is the Primary Key for the record in the given table. And an optional 3rd column "alternative name".

Now, what would be the best approach:

  • create a 2nd table "list items" with a foreign key to the list_id, type and item_id
  • or would it be better to serialize the 3 columns (type, id, alternative) in text-column "item-data" in the lists-table?

Lists can be of any length although I don't expect many of them to be +100 items.

To clarify: I'v got 3 tables "Authors", "Books", "Magazines". The whole idea is that you can create a list with links any record in any of these tables. Eg "Top 10 authors" or "Top 100 Books and Magazines" (or any possible combination).

4

0 に答える 0