Finished base SQL dao.