Updated query to match schema