Question: Show the apartment numbers of apartments with unit status availability of both 0 and 1.
Schema: create table view_unit_status (apt_id varchar, available_yn varchar, PRIMARY KEY (apt_id)); create table apartments (apt_number varchar, apt_id varchar, PRIMARY KEY (apt_number))
SQL: select t1.apt_number from apartments as t1 join view_unit_status as t2 on t1.apt_id = t2.apt_id where t2.available_yn = 0 intersect select t1.apt_number from apartments as t1 join view_unit_status as t2 on t1.apt_id = t2.apt_id where t2.available_yn = 1