In this SQL puzzle, we challenge you to determine the fiscal year in which an employee joined a company, considering that the fiscal year runs from April to March
Input Data:Expected Output Data:
Input data script:
CREATE TABLE #Empliyee
(
EmpID INT,
EmpName NVARCHAR(250),
DOJ DATE,
DOB DATE
)
INSERT INTO #Empliyee
VALUES
(1010,'Arayan','2020-09-29','1991-01-01'),
(1020,'Rajjab','2018-01-04','1989-05-28'),
(1030,'Shyam','2023-03-31','1992-04-14'),
(1040,'Sandy','2015-12-26','1985-12-26'),
(1050,'Latha','1999-02-25','1979-02-25'),
(1060,'Andru','1999-10-10','1978-10-10')
SELECT * FROM #Empliyee
Please try to answer the question, if you still not able to get it click below show button to see the answer.