title: SQL Query for Multiplication
body: <p>I have two relations(tables in SQL Database) having purely numbers. These two relations are to be imagined as Matrices.</p>
  
  <p>The Question is to write an SQL query to multiply there two relations as we do with normal matrix multiplication.</p>
  
  <p>I have been racking my brains for this.... But to no use :O</p>
  
  <p>Can anyone please help me out?????</p>
  
  <p><strong>Table number 1 :</strong> 
  <img src="https://i.stack.imgur.com/6z8ne.png" alt="enter image description here"></p>
  
  <p>@ Aaron Bertrand : </p>
  
  <p>I am using SQL Server 2008 R2
  The Screenshots of the tables are :</p>
  
  <p><strong>Table 1 :</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/EQdO1.png" alt="enter image description here"></p>
  
  <p><strong>Table 2 :</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/6W4aq.png" alt="enter image description here"></p>
  
  <p><strong>I used the Query :</strong> </p>
  
  <pre><code>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
  </code></pre>
  
  <p><strong>The Answer :</strong> </p>
  
  <p><img src="https://i.stack.imgur.com/f3gph.png" alt="enter image description here"></p>
  
  <p>This way is quite Easy rather than my original Matrix way as suggested by @Marcelo Cantos and @ypercube...</p>