If you are a regular reader of this blog – you will find no issue at all in resolving this puzzle. This contest is based on my experience with NuoDB.
If you are not familiar with NuoDB, here are few pointers for you.
In today’s contest you have to answer following questions:
What is the precision of the NuoDB’s NOW() function, which returns current date time?
Hint: Run following script on NuoDB Console Explorer section:
SELECT NOW() AS CurrentTime FROM dual;
Here is the image. I have masked the area where the time precision is displayed.
When I execute following script –
SELECT 'today' AS Today, 'tomorrow' AS Tomorrow, 'yesterday' AS Yesterday FROM dual;
I will get the following result:
NOW – What will be the answer when we execute following script? and WHY?
SELECT CAST('today' AS DATE) AS Today, CAST('tomorrow' AS DATE) AS Tomorrow, CAST('yesterday'AS DATE) AS Yesterday FROM dual;
Reference: Pinal Dave (http://blog.sqlauthority.com)