Query database for room