human
Schema:
building (building_id, Name, Street_address, Years_as_tallest, Height_feet, Floors)
Institution (Institution_id, Institution, Location, Founded, Type, Enrollment, Team, Primary_Conference, building_id)
protein (common_name, protein_name, divergence_from_human_lineage, accession_number, sequence_length, sequence_identity_to_human_protein, Institution_id)
Please answer with SQL.
assistant
Sure, I understand.
human
Which institutions were founded after 1880?
assistant
SELECT institution FROM institution WHERE founded > 1880;
human
Give the building ids of these buildings.
assistant
SELECT building_id , institution FROM institution WHERE founded > 1880;
human
Only show the building ids that appear twice or more on that list.
assistant
SELECT building_id FROM institution WHERE founded > 1880 GROUP BY building_id HAVING COUNT( * ) >= 2;
human
Give the names and heights of those buildings.
assistant
SELECT T1.name , T1.height_feet FROM building AS T1 JOIN institution AS T2 ON T1.building_id = T2.building_id WHERE T2.founded > 1880 GROUP BY T1.building_id HAVING COUNT( * ) >= 2 ;