wrote getflights method in sqlcommands