Task: Text to Code
Input (English): Step 1: For each row in employees table, find the corresponding rows in job_history table.
Step 2: find the number of different job_history's EMPLOYEE_ID of each value of employees's DEPARTMENT_ID in the results of step 1.
Step 3: find without repetition job_history's DEPARTMENT_ID in the results of step 1 whose corresponding value in step 2 is greater than or equals 4
Output (English): SELECT DISTINCT T2.DEPARTMENT_ID FROM employees AS T1 JOIN job_history AS T2 ON T1.EMPLOYEE_ID = T2.EMPLOYEE_ID GROUP BY T1.DEPARTMENT_ID HAVING Count ( DISTINCT T2.EMPLOYEE_ID ) > = 4