Exists Examples

Example 1

Select *
  From books
Where EXISTS
   (Select *
      From sales s
    Where b.book_id = s.book_id);


Example 2

Select *
  From invoices i
Where NOT EXISTS
   (Select *
      From payments p
    Where i.invoice_no = p.invoice_no);