Simple SQL Query for matrix multiplication