### Instruction: CREATE TABLE Employee (EmployeeId INT, UserId INT, ApplicationId INT, RoleId INT, ShiftId INT, UserName NVARCHAR, EmpCode NVARCHAR, FirstName NVARCHAR, LastName NVARCHAR, MiddleName NVARCHAR, FatherName NVARCHAR, ImageFilePath NVARCHAR, Phone NVARCHAR, CellPhone NVARCHAR, IsMobileNumberPublic BIT, OfficePhone NVARCHAR, Extension NVARCHAR, Email NVARCHAR, IsEmailIdPublic BIT, AlternateEmailId NVARCHAR, QuitDate DATETIME, DepartmentId INT, CompanyID INT, BranchID INT, DesignationId INT, ReligionId INT, NationalityId INT, BloodTypeId INT, BloodType NVARCHAR, MaritalStatusId INT, PlaceOfBirth NVARCHAR, BirthDate DATETIME, JoiningDate DATETIME, Gender NVARCHAR, HousePhone NVARCHAR, IsLeavedJob BIT, LeaveJobDate DATETIME, LeaveJobReason NVARCHAR, TaxID NVARCHAR, SocialSecurityNo NVARCHAR, Status INT, ReportingToEmpId INT, CreatedOn DATETIME, UpdatedBy INT, CreatedBy INT, UpdatedOn DATETIME, EmpStatusId INT, ReportingToHrId INT, EmployeeStatus NVARCHAR, title NVARCHAR, PFNo NVARCHAR, ESINo NVARCHAR, SeriesTypeID INT, EmpCodeValue NVARCHAR, IsEmployeeExit BIT, IsfullFinalsettelement BIT, ExitDate DATETIME, RepotingToEMPCode NVARCHAR, CTC DECIMAL, CreatedMachineIP NVARCHAR, UpdatedMachineIP NVARCHAR, IsTDSapplicable BIT, GrossPay DECIMAL, IsExcludePayroll BIT, ReportingToFunctionalManager INT, SubDepartmentId INT, Sub_SubDepartmentId INT, WorkerType INT, EmployeeGrade INT, EmpExitType NVARCHAR, JobLevelId INT, PayTypeId INT, ClientId INT)
CREATE TABLE Exit_Employee_Details (ResignationId INT, EmployeeId INT, ResgDate DATETIME, Reason NVARCHAR, NoticePeriod INT, LastWorkingDate DATETIME, NoticePeriod_EmpChoice INT, LastWorkingDate_EmpChoice DATETIME, IsActive BIT, CreatedOn DATETIME, UpdatedOn DATETIME, CreatedBy INT, CreatedMachineIP NVARCHAR, UpdatedBy INT, UpdatedMachineIP NVARCHAR, ApproveByIds NVARCHAR, DeclinedReason NVARCHAR, ResignationStatus NVARCHAR, NoticePeriod_ManagerChoice INT, LastWorkingDate_ManagerChoice DATETIME, DeclinedByIds NVARCHAR, TaskHandover NVARCHAR, AssetHandover NVARCHAR, AccountHandover NVARCHAR, ITHandover NVARCHAR, FinalExit NVARCHAR, HrHandover NVARCHAR) --Using valid MS SQL Server, answer the following questions for the tables provided above. -- Provide the names of employees in their 3-month notice period. 
### Response: SELECT E.FirstName, E.LastName, DATEDIFF(MONTH, EE.ResgDate, GETDATE()) as duraton FROM Employee AS E INNER JOIN Exit_Employee_Details AS EE ON E.EmployeeID = EE.EmployeeID  WHERE DATEDIFF(MONTH, EE.ResgDate, GETDATE()) between 1 and  12 order by DATEDIFF(MONTH, EE.ResgDate, GETDATE())