Querying using raw SQL statements