sparse matrix multiplication using sql