Which departments have some physicians primarily affiliated.
select * from affiliated_with where primaryaffiliation = 1
What are the distinct names of the departments?
select distinct t2.name from affiliated_with as t1 join department as t2 on t1.department = t2.departmentid where primaryaffiliation = 1