DECLARE @n INT;
SET @n = /* введите значение n здесь */;
SELECT
employee_id,
employee_name,
hire_date,
DATEDIFF(YEAR, hire_date, GETDATE()) AS years_of_service
FROM
employees
WHERE
DATEDIFF(YEAR, hire_date, GETDATE()) > @n;