Question: Find the total number of students and total number of instructors for each department.
Schema: create table department (dept_name varchar, PRIMARY KEY (dept_name)); create table student (id varchar, dept_name varchar, PRIMARY KEY (id)); create table instructor (dept_name varchar, id varchar, PRIMARY KEY (dept_name))
SQL: select count(distinct t2.id), count(distinct t3.id), t3.dept_name from department as t1 join student as t2 on t1.dept_name = t2.dept_name join instructor as t3 on t1.dept_name = t3.dept_name group by t3.dept_name