Both of your questions are not easy.
Moodle database activity only has one template for List View and one for Single View. You can try:
Link two database activities can't be done automatically, you can try this:
Thank you very much, I will look at all that I have a little time before me to adapt. A first glance allows me to think that it is very likely that I would find my solution.