Query list of entries from database