Changed sqlquery to more friendly api