Added sql query method