wrote sql for variants selection. To be tested later.