CRISIL Interview Question

How do segregate date time in sql