Accenture Interview Questions | SQL query?

Question

What is the result of following query?
select case when null=null then ‘Amit’ else ‘Rahul’ end from dual;

in progress 0
TheDataMonk 4 years 5 Answers 929 views Grand Master 0

Answers ( 5 )

  1. The answer will be Rahul because NULL is never equal to NULL.

  2. The answer will be Rahul because we cannot equalize NULL with NULL

  3. The answer is ” Rahul” because according to the three-valued logic of SQL, the result of null = null is not true but unknown.
    This is often not a problem because SQL generally treats unknown like false when making binary decisions

  4. The answer is “RAHUL” because according to the three-valued logic of SQL, the result of null = null is not true but unknown
    This is often not a problem because SQL generally treats unknown like false when making binary decisions

Leave an answer

Browse
Browse