Bitwise interview question

Basic Introduction,In logical test one query,one program and sql query.