SQL SERVER – Take the Quiz for a chance to win a Quadcopter Drone – Brain Teasers

It has been a long time since we ran quiz. So let us get ready for a quiz. The quiz has two parts. You have to get both the parts correct to win Quadcopter with Camera (we will call it drone). We will be giving away a total of 2 Quadcopters.

The quiz is extremely easy and I will ship the Drone anywhere in the world where Amazon will ship it.

Let us jump directly to the quiz. Please complete all the three questions of the contest. 

Contest Part 1: Brain Teasers

There are two questions for you in this part of the contest.

Question: There are two 7s. How will you write select statement with a single operator that returns single 7?

Hint: SELECT 7(Answer)7

Question: Write down the shortest code that produces 1 without using any numbers in the select statement?

Hint: SELECT (Answer)

Contest Part 2: Download and Activate Rapid SQL

Question: Download and Activate Rapid SQL.

Hint: You have to download and activate Rapid SQL. If you do not activate Rapid SQL, you will be disqualified for the contest. Why take risk, let us start!

That’s it!

Just answer above questions in the following comments area, in following format.

Remember:

  • Use comments area right below the blog to take participation in the contest
  • Answer before June 5, 2014 midnight GMT.
  • The winner will be announced on June 8.
  • The winner will be selected randomly from all the valid answers.
  • All the valid answers will be kept hidden till June 5, 2014.
  • There will be a total of two winners.
  • The contest is open for any country of the world where Amazon ships products.

Reference: Pinal Dave (http://blog.sqlauthority.com)

About these ads

163 thoughts on “SQL SERVER – Take the Quiz for a chance to win a Quadcopter Drone – Brain Teasers

  1. These are the most concise answers I can think of;

    1. Select 7&7 2. Select CAST(‘TRUE’ as bit) 3. fyi – DoD lists this as a black hole site. I’ll download at home.

    You can also use the bitwise operator for ‘or’ instead of the bitwise operator for ‘and’, i.e.;

    Select 7|7

    I feel like there must be a shorter statement for Q2, but darned if I can think of it.

    Tony

  2. Hi,

    *Question:* There are two 7s. How will you write select statement with a single operator that returns single 7?

    Hint: SELECT 7(Answer)7 SELECT 7 *(+7-)* 7

    Thanks Justine

    Yours Sincerely,

    *Justine Clement A.*

  3. Hi Pinal,

    My answers below:
    –Question: There are two 7s. How will you write select statement with a single operator that returns single 7?

    select 7 | 7

    –Question: Write down the shortest code that produces 1 without using any numbers in the select statement?

    select count(*)

    – I have also installed and activated Rapid SQL. I will take it for a spin these days :)

  4. Part 1
    SELECT 7|7
    SELECT LEN(‘A’)

    Part 2
    What do you mean by download and activate? Do I have to buy that application?

  5. Hi All,

    There are over 20 valid entries, but there are few which have yet not downloaded and activated RapidSQL.

    All three parts of the contests have to be completed to have valid entry in the contest.

  6. Question: There are two 7s. How will you write select statement with a single operator that returns single 7?

    Ans. select 7&7

    Question: Write down the shortest code that produces 1 without using any numbers in the select statement?

    Ans. select cast(‘TRUE’ as bit)

  7. Hi Dave,
    answers are :
    1. select 7&7
    2. select (1)

    3. I have installed Rapid SQL trial version successfully.

    • Hi Madhu,

      At the end of the contest, we will check your answers and valid activation of the RapidSQL. Once that is done. We will announce the winner and will reach out to you via email. At that time you can specify your shipping address.

  8. Hi,

    If i download and install RapidSql, how will you come to know?
    Also, you have mentioned that we need to activate. IS activate means purchasing the license?

    • Hi Madhu,

      You need to use the same email address which you want leave here as a comment or provide the email address which you have used to register for the product. You do not have to purchase the product. Trial download and installation should do it.

  9. select 7&7 — We can also use select 7|7
    select ’1′ — ’1′ is Char, not a number

    – — Alternative options for second part without cheating :)
    select exp($) — 6 Chars, but this only works in latest version like SQL 2014
    select exp(”) — 7 EXP function is documented only to accept float but it works at least from SQL 2005
    select len(‘ ‘) — 8 This is my last option…

    —- Not sure of the format but I hope this is okay… vijay.k@live.com (vijred)

  10. not completely sure i understand the first question, but this is fun. where are the two 7s? in a table? if i have misunderstood the question, that’s ok. then i have participated for fun and learning.

    (answer)
    SELECT 7
    from sevens
    group by number

    (answer)
    select count(*)

  11. Answers (Contest Part 1)
    Question1—>
    1st Method: select 7|7
    go
    2nd Method: select 7&7
    go

    Question2—>
    1st Method: select count(*)
    go
    2nd Method: select cast(rand() as bit)
    go

    Contest Part 2 –> downloading….

    Are my answers correct???

  12. Hi,

    Is it ok if there is any delay for completing contest 2 soon after completing contest 1
    I mean to ask, is there any restriction that both the contests should be completed in quick succession without much gap between contests?

  13. Pinal, I apologize if this is a duplicate post–I had trouble logging into WordPress and wanted to make sure my comment posted.

    SELECT 7|7
    SELECT COS($)
    I’ve downloaded and installed RapidSQL.

  14. 1.Question: There are two 7s. How will you write select statement with a single operator that returns single 7?
    Ans : SELECT 7 & 7

    2.Question: Write down the shortest code that produces 1 without using any numbers in the select statement?

    Ans : SELECT CEILING(RAND())

  15. Hello Sir,
    I have given answer in the comment and activated Rapid SQL. Can you confirm my candidature for the contest?

  16. Hi,

    first answer is:
    select 7 & 7
    – or:
    select 7 | 7

    second answer is:
    select COUNT(*) from (select ‘a’ as a) as a

  17. Hi Pinal,
    My answer is as below:
    Question: There are two 7s. How will you write select statement with a single operator that returns single 7?
    Answer : Select 7 | 7

    Question: Write down the shortest code that produces 1 without using any numbers in the select statement?

    Answer: Select count (”)

    And I have also installed Rapid SQL.

    Thanks,
    Prabhat

  18. Contest Part 1:
    Answer for Question 1: bitwise AND operator and bitwise OR operator gives the same result Select 7&7, Select 7|7
    Answer for Question 2: select CONVERT(bit, ‘TRUE’)
    Contest Part 2: I have installed and activated the rapid sql.

  19. Hello Sir,
    Part 1:
    Question 1: Produce Single 7 using 2 7s and single operator
    Answer 1 : Select 7&7;

    Question 2 : Write Shortest code to product digit 1 without using any number
    Answer 2 : Select Len(‘a’);

    Part 2:
    Downloaded and Activated Rapid SQL Trial Version with the following email id:
    skant@sapient.com

    I will wait eagerly for the results announcement.

    Thanks
    Shashi Kant

  20. —-Question: There are two 7s. How will you write select statement with a single operator that returns single 7?
    SELECT 7&7

    —-Question: Write down the shortest code that produces 1 without using any numbers in the select statement?
    SELECT ISDATE(GETDATE())

  21. Contest Part 1: Brain Teasers
    Select 7&7
    Select 1

    Contest Part 2: Download and Activate Rapid SQL
    Downloaded, installed & activated RapidSQL

  22. Answers are as follows
    1) SELECT 7 & 7 will produce 7 as output.
    2) SELECT LEN(‘*’) will produce 1 as output.
    not only one any single alphabetic in the LEN() function will produce output 1

  23. Question 1 – two answers:
    SELECT 7&7
    SELECT 7|7

    Question 2 – four answers:
    SELECT CONVERT(BIT,’true’)
    SELECT USER_ID(‘dbo’)
    SELECT SIGN(@@SPID)
    SELECT EXP(”)

  24. Pingback: SQL SERVER – Contest Winner – What Next on SQL in Sixty Seconds – Poll Result | Journey to SQL Authority with Pinal Dave

  25. /*Question: There are two 7s. How will you write select statement with a single operator that returns single 7?*/
    SELECT 7 | 7
    /*Question: Write down the shortest code that produces 1 without using any numbers in the select statement?*/
    SELECT 1
    /*Product: Rapid SQL XE5 Trial – 14 days

    Serial Number(s): MEFE-NX6D5W-LZXPNG-3DBZ

    Login Name: aytekoz@yahoo.com

    First Name: aytekin

    Last Name: ozdemir
    */

  26. Answer 1: select 7 & 7
    Answer 2: SELECT COS($) Or SELECT DAY($) Or SELECT EXP($)
    Answer 3: I have downloaded and activated Rapid SQL

    Here are my Information
    ——————————–
    Login Name: yourlast@hotmail.com
    First Name: Abdisamad
    Last Name: Khalif

  27. I Answered all the question, Question #1 and #2, and i have downloaded Rapid SQL and even activated, i wish good luck.

    Thanks Mr Pinal Dave

  28. Contest Part 1: Brain Teasers

    Q1 : Answer : select 7&7

    Q2 : Answer : select count(*)

    Contest Part 2: Download and Activate Rapid SQL

    Download and Activated Rapid SQL.

  29. Answers to the questions asked in the contest:

    Answer for Question 1: Select 7|7
    Answer for Question 2: SELECT ISNUMERIC(CAST(” AS INT))

    • Hello sir,
      I have done with the last step of Rapid SQL. I have register with it. Rapid SQL looks awsome pinal sir.

  30. Hi Pinal,

    Contest Part 1: Brain Teasers

    Answer 1: Bitwise AND operator ‘&’
    SELECT 7 & 7

    Note: I can get the same answer using Bitwise OR operator ‘|’

    Answer 2: Find the length of any single character specified in string expression
    SELECT LEN(‘A’)

    Note: I can use other string functions to get the desired answer but this is the shortest code.

    Contest Part 2: Download and Activate Rapid SQL

    Answer: Downloaded and activated Embarcadero product Rapid SQL XE5 Trial (8.6.1, 32-bit).

    Kind Regards,
    Hitesh Shah

  31. Hi Team,

    Thank you for wonderful participation. We are evaluating various entries as well as matching the activation of RapidSQL. The winner will be announced on next week Monday.

  32. Hi All,

    We have received a fantastic response to the contest. We went through all the answers. There are multiple right answers as you can see in the contest. We selected the answer which was satisfying all the needs of the question and later, for now we are checking the activated RapidSQL. Soon we will get the winner.

    We expect that winner will be announced here in next 24 hours.

    Thank you so much!

  33. Hi Team,

    We have reached to the winner of this contest.

    John http://blog.sqlauthority.com/2014/05/28/sql-server-take-the-quiz-for-a-chance-to-win-a-quadcopter-drone-brain-teasers/#comment-1073065 and

    Raj Srinivas http://blog.sqlauthority.com/2014/05/28/sql-server-take-the-quiz-for-a-chance-to-win-a-quadcopter-drone-brain-teasers/#comment-1070302

    .. are the winner of the contest and have confirmed his email address as well as answer.

    Please reach out to me with your address so I can get your drone shipped to you.

    Everybody else – thank you so much for participating you guys are wonderful. We will have more interesting contests in the future and you are all welcome to participate.

    Pinal Dave

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s