SQL – Contest to Get The Date – Win USD 50 Amazon Gift Cards and Cool Gift

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:

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.

SQL - Contest to Get The Date - Win USD 50 Amazon Gift Cards and Cool Gift quiz1

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:

 SQL - Contest to Get The Date - Win USD 50 Amazon Gift Cards and Cool Gift quiz2

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;

SQL - Contest to Get The Date - Win USD 50 Amazon Gift Cards and Cool Gift quiz3

HINT: Install NuoDB (it takes 90 seconds).

Prizes:

  • 2 Amazon Gifts
  • 2 Limited Edition Hoodies (US resident only)

SQL - Contest to Get The Date - Win USD 50 Amazon Gift Cards and Cool Gift noudb hoodies  SQL - Contest to Get The Date - Win USD 50 Amazon Gift Cards and Cool Gift amazoncard

Rules:

  • 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/ )

Previous Post
SQL SERVER – NuoDB in Sixty Seconds – SQL in Sixty Seconds #053
Next Post
SQL SERVER – Storing 64-bit Unsigned Integer Value in Database

Related Posts

28 Comments. Leave new

  • 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

    Reply
  • By running following script
    SELECT NOW() AS CurrentTime
    FROM dual;
    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
    FROM dual;

    Answer 2:
    Today Tomorrow Yesterday
    25-6-2013 26-6-2013 24-62013

    Reply
  • First syntax will display current time with the precision of millisecond

    Second answer is Today 25/6/2013
    Tomorrow 26/6/2013
    Yesterday 24/6/2013

    Reply
  • Hi Team,

    This contest is over and we will announce the winners very soon!

    Reply
  • Was there any announcement I may have missed?

    Reply
  • Hi Team,

    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
    Samy
    Elie

    NuoDB Hoodies
    Michael Buescher
    James

    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

    Reply

Leave a Reply

Menu