I have the following tables in my db (it\'s not complete here, but I think that\'s possible to understand the idea).