<prompt> Kutokana na meza ya mshahara wa wafanyakazi na nguzo EmployeeID, mshahara, StartDate, na EndDate, kuandika SQL query kupata wastani wa mshahara wa wafanyakazi ambao wamefanya kazi angalau miezi 6 na wameacha kampuni ndani ya mwaka uliopita.  <response>: Here is an example SQL query to solve the problem:SELECT AVGSalary AS AverageSalaryFROM EmployeeSalariesWHERE EndDate DATEADDyear, -1, GETDATE AND DATEDIFFmonth, StartDate, EndDate 6;This query selects the average salary in the EmployeeSalaries table, where the EndDate is within the last year and the duration between StartDate and EndDate is at least 6 months. The DATEADD function is used to subtract 1 year from the current date GETDATE. The result is returned as a single column with an alias AverageSalary. 