added sql for finding tasks linear dependencies