Started working on database query