DBA > Job Interview Questions > Microsoft SQL Server FAQs

What does this code return? select 6 | 7 Fig

More DBA job interview questions and answers at http://dba.fyicenter.com/Interview-Questions/

(Continued from previous question...)

What does this code return?
select 6 | 7
Figure it out without running it.

Answer: 7

Explanation: This returns a 7, which is the result of an Inclusive OR between these numbers. These numbers are:
6 - 0110
7 - 0111
If you OR these numbers, you get a 7, which is 0111, all bits with 1s anywhere are returned.

(Continued on next question...)

Other Job Interview Questions