SELECT head_ID, department_ID FROM management WHERE "department_ID" > 11 OR "head_ID" = 3 OR temporary_acting = "No" UNION SELECT head_ID, department_ID FROM management WHERE "department_ID" != 7 AND temporary_acting != "Yes" OR "head_ID" <= 5 <table_name> : management col : department_ID | head_ID | temporary_acting row 1 : 2 | 5 | Yes row 2 : 15 | 4 | Yes row 3 : 2 | 6 | Yes row 4 : 7 | 3 | No row 5 : 11 | 10 | No <table_name> : management col : department_ID | head_ID | temporary_acting row 1 : 2 | 5 | Yes row 2 : 15 | 4 | Yes row 3 : 2 | 6 | Yes row 4 : 7 | 3 | No row 5 : 11 | 10 | No
col : head_ID | department_ID row 1 : 3 | 7 row 2 : 4 | 15 row 3 : 5 | 2 row 4 : 10 | 11