I have two relations(tables in SQL Database) having purely numbers. These two relations are to be imagined as Matrices.
The Question is to write an SQL query to multiply there two relations as we do with normal matrix multiplication.
I have been racking my brains for this…. But to no use :O
Can anyone please help me out?????
Table number 1 :

@ Aaron Bertrand :
I am using SQL Server 2008 R2
The Screenshots of the tables are :
Table 1 :

Table 2 :

I used the Query :
select t1.A,t2.B,SUM(t1.C*t2.C)
from Table_1 as t1 join Table_2 as t2 on t1.B=t2.A
group by t1.A,t2.B
order by t1.A
The Answer :

This way is quite Easy rather than my original Matrix way as suggested by @Marcelo Cantos and @ypercube…
Assuming the following structure:
You can write this:
EDIT: Using the tabular layout of the table to mimic a matrix structure makes this problem much more difficult, for at least two reasons:
The best work-around would be to add a row number column to each table thus…
…then synthesise the structure I suggest above as a view on each table…
…and finally use the SQL above to evaluate the answer. If necessary, you could write another view that converts the result back into a tabular structure.
Frankly, however, I consider all this to be very misguided. You will find things work much better with a row/col/value structure (and more logically coherent) than an A/B/C/… structure. Consider, for instance, how easily you can compute the transpose of a matrix using row/col/value:
or sum the diagonal:
and ask yourself how easy these would be using your structure.
P.S.: On the subject of logical coherence, your tables are not relations in the proper sense of the word, since they define an order on the rows, and must necessarily allow for duplicate rows, neither of which make sense in a relation, which is (loosely) defined as a set of tuples. This conflation of n-dimensional relations with 2-dimensional tables is at the heart of much that is ill with data management these days.