Sunday, 1 May 2016

Interview Questions -- SQL Scenarios -- Part-4

Interview Questions -- SQL Scenarios -- Part-4

Scenario-7:   What is the output of following
                 Question-1: SELECT 1 + NULL
          Ans :-                   :-
          Question-2: SELECT 1- NULL
          Ans :-        
          Question-3: SELECT 1* NULL
          Ans :-        

          Question-4: SELECT 1/ NULL
          Ans :-    


Scenario-8:   What is the output of following
                 Question-1:   SELECT CASE WHEN 1=1
                                   THEN 'True' else 'False' End
          Ans :-      
                 Question-2: SELECT CASE WHEN NULL=NULL
                                    THEN 'True' else 'False' End
          Ans :-      

Scenario-9:   What is the output of following
                 Question-1:   DECLARE @A INT
DECLARE @B INT
SET @A=1
SET @B=1
SELECT @A+@B AS ADDITION
          Ans :-      
                 Question-2:   DECLARE @A VARCHAR(100)
DECLARE @B VARCHAR(100)
SET @A=1
SET @B=1
SELECT @A+@B AS CONCATENATION
          Ans :-     



Guys you can share your Query Through Comments.

6 comments:

  1. Thank you for sharing such as wonderful articles. Those are very useful to MSBI learners. MSBI Online Training

    ReplyDelete
  2. Thank you for sharing useful information,
    It is very useful mostly useful to who are searching for Msbi online training.

    ReplyDelete
  3. DECLARE @A VARCHAR(100)
    DECLARE @B VARCHAR(100)
    SET @A=1
    SET @B=1
    SELECT @A+@B AS CONCATENATION

    Ans: 11

    ReplyDelete
  4. SELECT CASE WHEN NULL=NULL
    THEN 'True' else 'False' End

    Ans: False

    ReplyDelete