title: SQL query to show details of bookings that will be staying in a hotel on a specific night using only check in and check out dates
body: <p>Apologies if this is a stupid question, but I've scoured the net for answers and have found none. I'm also a student only learning to use SQL for a database class, so this is rather new to me.</p>
  
  <p>I'm doing an assignment which is based on a hotel database and must display the details of bookings that will be staying in the hotel on a specific night.</p>
  
  <p>The bookings table has the following columns:</p>
  
  <pre><code>booking_no  guest_no  room_no  date_in  date_out
  </code></pre>
  
  <p>The dates are formatted as (yyyy-mm-dd).</p>
  
  <p>The question is roughly as follows:</p>
  
  <p>"Write a query to display details of the bookings that will be staying in the hotel on the night of 18th March, 2018. This includes bookings that are checking in on the 18th of March and also bookings that checked in before this date but will not check out until after the 18th."</p>
  
  <p>I have tried the following query:</p>
  
  <pre><code>select *
  
  from bookings
  
  where date_in &lt;='2018-03-18' and date_out &gt;='2018-03-18'
  </code></pre>
  
  <p>but since there are two conditions both being satisfied exclusively, it does not work.</p>
  
  <p>I need a query which shows rows which only satisfy both of these conditions and not just one or the other.</p>