Bitwise Interview Question

Different queries of SQL