Question: Find the names of all physicians and their primary affiliated departments' names.
Schema: create table department (name varchar, departmentid varchar, PRIMARY KEY (name)); create table affiliated_with (physician varchar, department varchar, primaryaffiliation varchar, PRIMARY KEY (physician)); create table physician (name varchar, employeeid varchar, PRIMARY KEY (name))
SQL: select t1.name, t3.name from physician as t1 join affiliated_with as t2 on t1.employeeid = t2.physician join department as t3 on t2.department = t3.departmentid where t2.primaryaffiliation = 1