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.
- Step by Step Guide to Download and Install NuoDB – Getting Started with NuoDB
- Quick Start with Admin Sections of NuoDB – Manage NuoDB Database
- Quick Start with Explorer Sections of NuoDB – Query NuoDB Database
In today’s contest you have to answer following questions:
Q 1: Precision of NOW()
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.
Q 2: Executing Date and Time Script
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;
HINT: Install NuoDB (it takes 90 seconds).
- 2 Amazon Gifts
- 2 Limited Edition Hoodies (US resident only)
- Please leave an answer in the comments section below.
- You must answer both the questions together in a single comment.
- US resident who wants to qualify to win NuoDB apparel please mention your country in the comment.
- You can resubmit your answer multiple times, the latest entry will be considered valid.
- Last day to participate in the puzzle is June 24, 2013.
- All valid answer will be kept hidden till June 24, 2013.
- The winner will be announced on June 25, 2013.
- Two Winners will get USD 25 worth Amazon Gift Card. (Total Value = 25 x 2 = 50 USD)
- The winner will be selected using a random algorithm from all the valid answers.
- Anybody with a valid email address can take part in the contest.
Reference: Pinal Dave https://blog.sqlauthority.com/ )
NuoDB is a very nice product. I downloaded it immediately after reading this artile.
Here is my answer :
Precision of NOW() will display current date
When we we execute following script we get result Today Tomorrow Yesterday
By running following script
SELECT NOW() AS CurrentTime
Answer 1 : shows Current time
when we execute following script
SELECT CAST(‘today’ AS DATE) AS Today,
CAST(‘tomorrow’ AS DATE) AS Tomorrow,
CAST(‘yesterday’AS DATE) AS Yesterday
Today Tomorrow Yesterday
25-6-2013 26-6-2013 24-62013
First syntax will display current time with the precision of millisecond
Second answer is Today 25/6/2013
This contest is over and we will announce the winners very soon!
Was there any announcement I may have missed?
Yes I am also waiting for announcement…
I apologize for the delay. I just got the result back from the team.
Here are the name of the winners:
USD 50 Amazon Gift Card
Please send your address with phone number to ship the hoodies and valid email address to get USD 50 Amazon gift card to pinal at SQLAuthority.com