human
Schema:
department (Department_ID, Name, Creation, Ranking, Budget_in_Billions, Num_Employees)
head (head_ID, name, born_state, age)
management (department_ID, head_ID, temporary_acting)
Please answer with SQL.
assistant
Sure, I understand.
human
What are the names of the states where department heads were born?
assistant
SELECT born_state FROM head;
human
How many heads were born in each state?
assistant
SELECT born_state , COUNT( * ) FROM head GROUP BY born_state;
human
What are the names of the states where at least 3 heads were born?
assistant
SELECT born_state FROM head GROUP BY born_state HAVING COUNT( * ) >= 3 ;