add basic sql query functions