human
Schema:
architect (id, name, nationality, gender)
bridge (architect_id, id, name, location, length_meters, length_feet)
mill (architect_id, id, location, name, type, built_year, notes)
Please answer with SQL.
assistant
Sure, I understand.
human
How many bridges did each architect build?
assistant
SELECT COUNT( * ) FROM bridge GROUP BY architect_id;
human
What are the ids, names and genders of the architects who built two bridges?
assistant
SELECT T1.id , T1.name , T1.gender FROM architect AS T1 JOIN bridge AS T2 ON T1.id = T2.architect_id GROUP BY T1.id HAVING COUNT( * ) = 2 ;