### 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 NREC_JobTimeSheet (JobTimeSheetId INT, EmployeeId INT, ActivityId INT, ActivityDate DATETIME, TimeFrom DATETIME, TimeTo DATETIME, TotalTimeinMinutes INT, JobID INT, CreatedBy INT, CreatedOn DATETIME, CreatedMachineIp NVARCHAR)
CREATE TABLE FifthWeekLogTimesheet (LogTimeSheetId INT, ActivityId INT, EmpCode NVARCHAR, LogDate DATETIME, Day1 DATETIME, Day2 DATETIME, Day3 DATETIME, Day4 DATETIME, Day5 DATETIME, Day6 DATETIME, Day7 DATETIME, CreatedOn DATETIME, CreatedBy INT, UpdatedOn DATETIME, UpdatedBy INT, IsActive BIT, CreatedMachineIp NVARCHAR, UpdatedMachineIp NVARCHAR, IsDeleted BIT)
CREATE TABLE FirstWeekLogTimesheet (LogTimeSheetId INT, ActivityId INT, EmpCode NVARCHAR, LogDate DATETIME, Day1 DATETIME, Day2 DATETIME, Day3 DATETIME, Day4 DATETIME, Day5 DATETIME, Day6 DATETIME, Day7 DATETIME, CreatedOn DATETIME, CreatedBy INT, UpdatedOn DATETIME, UpdatedBy INT, IsActive BIT, CreatedMachineIp NVARCHAR, UpdatedMachineIp NVARCHAR, IsDeleted BIT)
CREATE TABLE FourthWeekLogTimesheet (LogTimeSheetId INT, ActivityId INT, EmpCode NVARCHAR, LogDate DATETIME, Day1 DATETIME, Day2 DATETIME, Day3 DATETIME, Day4 DATETIME, Day5 DATETIME, Day6 DATETIME, Day7 DATETIME, CreatedOn DATETIME, CreatedBy INT, UpdatedOn DATETIME, UpdatedBy INT, IsActive BIT, CreatedMachineIp NVARCHAR, UpdatedMachineIp NVARCHAR, IsDeleted BIT)
CREATE TABLE ThirdWeekLogTimesheet (LogTimeSheetId INT, ActivityId INT, EmpCode NVARCHAR, LogDate DATETIME, Day1 DATETIME, Day2 DATETIME, Day3 DATETIME, Day4 DATETIME, Day5 DATETIME, Day6 DATETIME, Day7 DATETIME, CreatedOn DATETIME, CreatedBy INT, UpdatedOn DATETIME, UpdatedBy INT, IsActive BIT, CreatedMachineIp NVARCHAR, UpdatedMachineIp NVARCHAR, IsDeleted BIT) --Using valid MS SQL Server, answer the following questions for the tables provided above. -- What is the count of employees with on-time timesheet submissions? 
### Response: SELECT COUNT(*) AS NumEmployeesWithOnTimeTimesheets
    FROM (
        SELECT EmployeeId
        FROM NREC_JobTimeSheet
    ) AS OnTimeJobTimeSheets
    INNER JOIN Employee e ON OnTimeJobTimeSheets.EmployeeId = e.EmployeeId
    LEFT JOIN FirstWeekLogTimesheet ON OnTimeJobTimeSheets.EmployeeId = FirstWeekLogTimesheet.EmpCode
    AND FirstWeekLogTimesheet.LogDate >= GETDATE()
    LEFT JOIN ThirdWeekLogTimesheet ON OnTimeJobTimeSheets.EmployeeId = ThirdWeekLogTimesheet.EmpCode
    AND ThirdWeekLogTimesheet.LogDate >= GETDATE()
    LEFT JOIN FourthWeekLogTimesheet ON OnTimeJobTimeSheets.EmployeeId = FourthWeekLogTimesheet.EmpCode
    AND FourthWeekLogTimesheet.LogDate >= GETDATE()
    LEFT JOIN FifthWeekLogTimesheet ON OnTimeJobTimeSheets.EmployeeId = FifthWeekLogTimesheet.EmpCode
    AND FifthWeekLogTimesheet.LogDate >= GETDATE()
    WHERE FirstWeekLogTimesheet.Day1 IS NOT NULL
    OR ThirdWeekLogTimesheet.Day1 IS NOT NULL
    OR FourthWeekLogTimesheet.Day1 IS NOT NULL
    OR FifthWeekLogTimesheet.Day1 IS NOT NULL