Added the other db methods and wrote the actual sql for it