'Iterate "matrix" with sql

I have a table Question, and I have a table Options that has a questionId in it as a foreign key, and I have a table Answers that is related to a Research table, therefore has a researchId as a foreign key. I also have a table Answers_options that has my OptionsId on it registering the answers.

I need to calculate the percentage of answers of structure like a matrix, as shown here:

I know how to calculate a cell, but when I tried to calculate all the options and the equivalent I failed. I need to be able to calculate the percentage of who answers op1 in the questionY with op1 in the questionX, op1 with op2...

I calculated a cell and it work, but I could not calculate for all options combined of the two question selected.

Edit: I hope that helps, i tried to add a image that represents my tables, if you need more information i can add more.

enter image description here tables here

The column cel op1 with op1 represents the percentage of answers where people responded op1X with op1Y. The percentage is based on the answers of the column. So if one guy answer op1 with op1 and another guy answer op1X with op2Y. It would register as op1X with op1Y as 50% and op1X with op2Y 50% and the op1X with op3Y 0%.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source