Situation
Let's say I have the following:
- table
items - table
listswith which these items can be associated - table
users
Condition: the list may belong to all or one specific user
I would like to create global lists that exist forever. But it should be possible to "overwrite" this global custom list. Example for a random user:
- global list called books
- custom cds list
Now, getting lists for this user, I should get both lists of books around the world, and a list of accounts for a specific user. But what if this user has a specific list of books?
- global list called books
- cds
, , , , , , -, .
- :
table: lists
- id
- name
- userId
userId IS NULL , , NOT NULL . , userId = 1:
id name userId
1 books NULL
2 cds 1
:
SELECT * FROM lists WHERE userId = 1 OR userId IS NULL
:
id name userId
1 books NULL
2 cds 1
3 books 1
"" , "" . ?
- lists_users, , , . , .
:
, ?