All Tracks Problem

Special Years



You are given a table Employee.

Employee: It will consist of 2 column, first is Employee Id, and second is the Joining Date of that employee.

Date format will be: YYYY-MM-DD

You need to find the number of joinings happened on the even days, for all the special years in the given data.

Special years are the ones, in which joining happened only in the even months in the given data.

1) Even months of an year are : February ($$2^{nd}$$ month), April ($$4^{th}$$ month) and so on.

2) Number of even days of a normal year are:

Given dates: 1999-12-01 (odd day), 1999-02-02 (even day), 1999-06-08 (even day). Here number of joinings happened on even days for year 1999 is 2.

Note: Output the data in the ascending order of the Special Year.

Input Format:

Table : Employee

Field Type
EmployeeID int
JoiningDate Date

Output Format:

Field Type
Special_Year int
EvenDays int

Sample Input:

Sample Employee Table:

EmployeeID JoiningDate
1 1998-12-01
2 1998-06-02
3 1998-02-28
4 2000-04-16
5 2000-04-18
6 2000-06-18
7 1999-08-12
8 1999-10-14
9 1999-10-15
10 2002-01-12
11 2002-02-14

Sample Output:

Special_Year EvenDays
1998 2
1999 2
2000 3
Time Limit: 5 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: MySQL, PostgreSQL, MSSQL, Oracle Database


Initializing Code Editor...
Your Rating:


View All Notifications