title: Mysql return 1 if value found or not at all present, If other values present, return 0
body: <p><br>
  I need to get all the students' details who either are in room number 6 or 7 or not at all in any room. If they are in other rooms, simply, I don't wish to have that record.<br>
  My schema is:<br></p>
  
  <pre><code>students(roll_no, name,class,...)
  rooms(room_no,...)
  student_room(room_no,roll_no).
  </code></pre>
  
  <p>students and rooms are related via <code>student_room</code> table.
  But, I am unable to figure out how to write the query for this.</p>