I got a DB where I have 3 tables.
which contains users. Each User needs to specify his 3 branches. Like , Electronic, Architecture or Paintings.
contains ads which can be assigned to different branches. Like above, Electronic, Architecture, Gaming, Gambling, etc.
contains these informations which user is assigned to which branch. And each advert can be also assigned to branches.
So note: User fits into max 3 branches. One Advert can also fit into branches.
Now my logic problem starts here. How can I select all adverts where the user matches his defined branches? Do I need to add the same branchdepencies table twice as a JOIN ? One where I match the t_user defined branches and then again and try to match the t_advert defined branches?
Smth like that? Its the same table, but used twice