added sql query