'SQL select query need task

I have two tables city and house (foreign key to house), I need get result true if city's all houses has property has_door = true. enter image description here



Solution 1:[1]

Something like this:

select c.name, min(has_door) as all_houses_in_city_have_doors
from city c 
join house h on h.city_id = c.id
group by c.id, c.name

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 juergen d