title: How to use Inner Join and Left Outer Join together?
body: <p>I have two queries and I have to merge the second query into the 1st one such that it fetches the details of only those items that are currently present in the shelf( of all departments for that particular store Id).</p>
  <p>Tables :</p>
  <pre><code>Item : item, uniqueLabel, ItemScale, ItemExpiry  // columns can have duplicates
  
  Description : uniqueLabel, itemName //fields have unique value
  Store :  StoreId, ShelfNo  // fields have unique values
  Department : ShelfNo, ItemNo ( There can be duplicate items in a single Shelf)
  </code></pre>
  <p>I need to merge these two functionalities into one.</p>
  <p>Query 1 to fetch details of items.</p>
  <pre><code>select item, Description.itemName, ItemScale, ItemExpiry 
  from Item left outer join Description on (Item.uniqueLabel = Description.uniqueLabel)
  where Item.uniqueLabel like '11%' //uniqueLabel starting from 11
  order by Item.uniqueLabel
  </code></pre>
  <p>Query 2 to fetch details of all items that are in the Shelf(of all departments) for that store.</p>
  <pre><code>select itemNo from Store, Department
  where Store.ShelfNo = Department.ShelfNo
  and Department.itemNo is not null and Store.StoreId in('12345')
  </code></pre>
  <p>My Effort :</p>
  <pre><code>select itemNo, Description.itemName, ItemScale, ItemExpiry
  
  from Item, Description, Department
  
  where Department.itemNo = Item.item
  
  Item.uniqueLabel = Description.uniqueLabel
  
  where Item.uniqueLabel like '11%' 
  </code></pre>
  <p>But this is fetching a lot amount of data.</p>