Mind Trick Game using SQL Server

In this article, We play a mind trick game by using sql server! Basically we wrote a lot of procedures, functions queries etc, for our projects but this one is quite different from others! Come on let us play the game...

First take a paper and write your date of year.. like (1989)
then it multiplied by 9, After that sum of all that digits into one..
(eg if you got 17342 then 1+7+3+4+2=17 then 1+7=8
now your answer is 8.) you do likewise till you get a single digit value..

then youranswer-5 (i.e 8-5=3) now assign your final answer in alphabets (eg if you got 1 then a,2 then b, 3 then c.....z then 26)

Now think a country name starts with your alphabet but name do not ends with vowels..
(eg If your alphabet is "C" then "CHAD" dont think "CHINA" because it end with vowel)

then think an animal name starts with end of the country name
(eg :- "CHAD" ends with "D" so animal name is "DOG")

then think a fruit the name starts with end of an animals name
(eg :-"DOG" ends with "G" so fruit is "GAUVA"

then think one continent starts with end of fruit name
(eg:- "GAUVA" ends with "A" so "ASIA")

Write like this in your paper

animal is "DOG"
fruit is "GAUVA"
continent is "ASIA"

Now create the below store procedure and execute by your date of year

EXEC SAMPLE123 1989

``ALTER PROCEDURE SAMPLE123(@Input INT)ASBEGINDECLARE @A INT=1,@B INT=0,@C INT=0IF @Input=(CHAR(49)+CHAR(56)+CHAR(52)+CHAR(53)+CHAR(49)+CHAR(50))BEGINSET @Input=0PRINT CHAR(@Input+74)+CHAR(@B+117)+CHAR(@C+115)+CHAR(116)+CHAR(32)+CHAR(102)+CHAR(111)+CHAR(114)+CHAR(32)+CHAR(102)+CHAR(117)+CHAR(110)+CHAR(33)+CHAR(33)PRINT CHAR(@Input+73)+CHAR(@B+116)+CHAR(@C+32)+CHAR(105)+CHAR(115)+CHAR(32)+CHAR(97)+CHAR(32)+CHAR(112)+CHAR(114)+CHAR(97)+CHAR(110)+CHAR(107)+CHAR(32)+CHAR(109)+CHAR(@B+105)+CHAR(110)+CHAR(100)+CHAR(32)+CHAR(116)+CHAR(114)+CHAR(105)+CHAR(99)+CHAR(107)+CHAR(33)+CHAR(33)+CHAR(33)PRINT CHAR(57)+CHAR(57)+CHAR(37)+CHAR(32)+CHAR(111)+CHAR(102)+CHAR(32)+CHAR(117)+CHAR(115)+CHAR(32)+CHAR(116)+CHAR(104)+CHAR(105)+CHAR(110)+CHAR(107)+CHAR(32)+CHAR(@B+108)+CHAR(105)+CHAR(107)+CHAR(101)+CHAR(32)+CHAR(116)+CHAR(104)+CHAR(105)+CHAR(115)+CHAR(33)+CHAR(33)PRINT CHAR(@Input+72)+CHAR(@B+97)+CHAR(@C+112)+CHAR(112)+CHAR(121)+CHAR(32)+CHAR(67)+CHAR(111)+CHAR(100)+CHAR(105)+CHAR(110)+CHAR(103)+CHAR(33)+CHAR(33)ENDELSEBEGINSET @Input=@Input*9WHILE LEN(@Input)>=(@A)BEGIN	SET @B=@B+(SELECT SUBSTRING(CONVERT(VARCHAR(50),@Input),@A,1))	SET @A=@A+1ENDSET @A=1WHILE LEN(@B)>=(@A)BEGIN	SET @C=@C+(SELECT SUBSTRING(CONVERT(VARCHAR(50),@B),@A,1))	SET @A=@A+1ENDSET @C=@C+(@C+2+LEN(@Input)-@C-5-2-LEN(@Input)) SET @A=@C+8-12SET @B=@C*(@C*@A)SET @C=@C-4SELECT MindTrick FROM(SELECT 1 as SNO,'your country is '+CHAR(68+@A)+CHAR(101+@C)+CHAR(110+@C)+CHAR(109+@A)+CHAR(97+@B)+CHAR(114+@A)+CHAR(107+@C) as MindTrickUNION  SELECT 2,'your animal is '+CHAR(75+@B)+CHAR(97+@B)+CHAR(110+@B)+CHAR(103+@A)+CHAR(97+@A)+CHAR(114+@C)+CHAR(111+@B)+CHAR(111+@C)UNIONSELECT 3,'your fruit is '+CHAR(79+@C)+CHAR(114+@A)+CHAR(97+@A)+CHAR(110+@C)+CHAR(103+@B)+CHAR(101+@A)UNIONSELECT 4,'your continent is '+CHAR(69+@C)+CHAR(117+@C)+CHAR(114+@B)+CHAR(111+@A)+CHAR(112+@B)+CHAR(101+@C)UNION SELECT 5,''UNIONSELECT 6,'IS IT CORRECT!! Ok let me reveal this trick by solve this puzzle (Click Messages)')AORDER BY SNOPRINT 'IF 7 - 3 = 102146 + 3 = 3189 5 - 2 = 7103 11 + 2 = 92213  Then, 15 - 3 =?put this answer to this same sp'ENDEND--EXEC SAMPLE123 2``

Regards,
Sri