Sorry to sound a bit vague there. Allow me to explain how SQL will behave when 2 tables are joined. Suppose there are two tables with 3 records each:
Table X
a
b
c
Table Y
1
2
3
Then by default, a JOIN will yield the following result:
a 1
a 2
a 3
b 1
b 2
b 3
c 1
c 2
c 3
And this is achieved by just ONE line of code. Since you are looking at multiplying rows and columns, this might give you a shortcut rather than writing a long program to do this.
Hope this helps!
Rishabh.