CRUD functionality written in raw SQL