finished writing sql for matrix multiplication