Task: Text to Code
Input (English): Step 1: For each row in Appointment table, find corresponding rows in Physician table and in Nurse table.
Step 2: find Physician's Name of the results of step 1 whose Nurse's Name equals Surgery or Nurse's Name equals Psychiatry
Output (English): SELECT T1.Name FROM Physician AS T1 JOIN Nurse AS T2 JOIN Appointment AS T3 ON T1.EmployeeID = T3.Physician AND T3.PrepNurse = T2.EmployeeID WHERE T2.Name = "Psychiatry" OR T2.Name = "Surgery"