title: How to improve this SQL?
body: <p>My boss sent us a query and asked us to replace it with a more efficient version and to achieve following objective: </p>
  
  <blockquote>
    <p>Get all records from <code>PACKAGE</code> table which has at least 1 record in <code>PASS_PACKAGE_DETAILS</code> table.</p>
  </blockquote>
  
  <p>Given SQL:</p>
  
  <pre><code>SELECT DISTINCT 
      pckg.*  
  FROM 
      PASS_PACKAGE pckg 
  JOIN 
      PASS_PACKAGE_DETAILS pckg_dtl ON (pckg.PACKAGE_ID = pckg_dtl.PACKAGE_ID) 
  WHERE 
      IS_ACTIVE = 1 
      AND '2015/04/22' BETWEEN DATE_START AND DATE_END 
  ORDER BY 
      PACKAGE_NAME
  </code></pre>
  
  <p>Correct me if I'm wrong, but I believe query above will slow down the performance due to the <code>JOIN</code> method. After reading <a href="https://stackoverflow.com/a/3964770/4225159">this</a>, I'm wondering which of my query does really achieved my boss requirement and why.</p>
  
  <p>My SQL :</p>
  
  <p>Attempt #1 - using <code>IN</code>:</p>
  
  <pre><code>SELECT
      pckg.*
  FROM 
      PASS_PACKAGE pckg
  WHERE 
      IS_ACTIVE = 1
      AND '2015/04/22' BETWEEN DATE_START AND DATE_END 
      AND pckg.PACKAGE_ID IN (SELECT DISTINCT pckg_dtl.PACKAGE_ID 
                              FROM PASS_PACKAGE_DETAILS pckg_dtl)
  ORDER BY 
      PACKAGE_NAME
  </code></pre>
  
  <p>Attempt #2 - using <code>EXISTS</code>:</p>
  
  <pre><code>SELECT 
      pckg.*
  FROM 
      PASS_PACKAGE pckg
  WHERE 
      IS_ACTIVE = 1
      AND '2015/04/22' BETWEEN DATE_START AND DATE_END 
      AND EXISTS (SELECT pckg_dtl.PACKAGE_ID 
                  FROM PASS_PACKAGE_DETAILS pckg_dtl
                  WHERE pckg_dtl.package_id = pckg.package_id)
  ORDER BY 
      PACKAGE_NAME
  </code></pre>
  
  <p>Hope to get some valuable information from experts here! </p>
  
  <p>EDIT: I'm using SQL Server Management Studio. My execution time is kinda weird. For <code>IN</code> method, 1st execution will take around 90+ ms, 2nd execution like 200 ms, 3rd execution back to 90+ ms. So I'm not sure which execution time I should refer to. Same goes for the <code>EXISTS</code> method.</p>