Tags
Complex SQL Challenges, Complex TSQL Challenge, Interview Qs.SQL SERVER Questions, Interview questions on Joins, Interview Questions on SQL, InterviewQuestions, InterviewQuestions for SQL, Joins, Joins Interview questions, Joins Puzzle, Learn complex SQL, Learn SQL, Learn T-SQL, Objective Puzzle, Perfect Numbers, PL/SQL Challenges, Puzzles, Queries for SQL Interview, SELECT Puzzle, SQL, SQL 2012, SQL 2014, SQL 2014 Interview Questions, SQL Challenge, SQL Challenges, SQL Joins, SQL pl/sql puzzles, SQL Puzzles, SQL Queries, SQL SERVER Interview questions, SQL Skills, SQL Sudoku, SQLSERVER, T SQL Puzzles, T-SQL Challenge, Tough SQL Challenges, Tough SQL Puzzles, TSQL, TSQL Challenge, TSQL Challenges, TSQL Interview questions, TSQL Queries
T-SQL Query | [ The ASCII Puzzle ]
Puzzle Statement
We have characters A to Z if the input is A then it should be print Z, if the input is B then o/p will be Y.
Sample Input & Corresponding Expected Output
Sample Input | Expected Output |
Z | A |
A | Z |
B | Y |
C | X |
UPDATE – 25-Apr-2015 – Solution 1
-- DECLARE @t AS VARCHAR(1)= 'C' SELECT CHAR(ASCII('A') + ASCII('Z') - ASCII(@t)) -- |
Add a comment if you have any other solution in mind. We all need to learn.
Keep Learning