Java Enum and extract in SQL

Java class with enum switch statement is translated to switch statement with ordinal:

public enum  MyEnum {
    YES,
    NO;

    public static void main(String[] args) {
        MyEnum e = NO;
        switch (e) { // uses e.ordinal()
            case YES:
                System.out.println("Yes");
                break;
            case NO:
                System.out.println("No");
                break;
        }
    }
}

You can use extract() in oracle in order to get the date parts

select
    extract(year from created_timestamp),
    extract(month from created_timestamp),
    extract(day from created_timestamp)
from student;

Source: EXTRACT