I’m creating a website and part of the functionality is that a user can create a list. Each user can only have one list, and each list only has one user. Each list also has a bunch of items. Items can be used in multiple lists.
So let’s say I have the following tables:
- Users
- Lists
- Items
How can I define which items a list has? Right now I’m storing a string of CSV’s in the Lists table, but I doubt that’s the best way.
Thanks!
Typically you would have table definitions like:
such that:
Note that you could skip the list table altogether if you didn’t need list-specific data like a name.