<prompt> Tuseme una meza inayoitwa wafanyakazi na safu wafanyakazi_id, jina, kuanza_tarehe, na department_id. Andika SQL query kupata mfanyakazi na muda mrefu zaidi katika kila idara.  <response>: Heres one way to write the SQL query:SELECT e.department_id, e.name, DATEDIFFNOW, e.start_date AS tenure_daysFROM employees eWHERE NOT EXISTS SELECT 1 FROM employees e2 WHERE e2.department_id e.department_id AND DATEDIFFNOW, e2.start_date DATEDIFFNOW, e.start_dateThis query uses a subquery with NOT EXISTS to filter out rows where there exists another employee in the same department with a longer tenure. The main SELECT statement calculates the tenure of each employee in days using DATEDIFF and returns the department ID, employee name, and tenure. 