I am trying to design an SQL lite database. I have made a quick design on paper of what I want.
So far, I have one table with the following columns:
user_id
(which is unique and the primary key of the table)number_of_items_allowed
(can be any number and does not have to be unique)list_of_items
(a list of any size as long as it is less than or equal to number_of_items_allowed and this list stores item IDs)
The column I am struggling the most with is list_of_items
. I know that a relational database does not have a column which allows lists and you must create a second table with that information to normalise the database. I have looked at a few stack overflow answers including this one, which says that you can't have lists stored in a column, but I was not able to apply the accepted answer to my case.
I have thought about having a secondary table which would have a row for each item ID belonging to a user_id
and the primary key in that case would have been the combination of the item ID and the user_id
, however, I was not sure if that would be the ideal way of going about it.