Fragments making query on database