title: Find all customers who have both an account and a loan at the Perryridge branch
body: <p>I have some tables:</p>
  
  <ul>
  <li>"branch" table(branch_name, branch_city, assets)</li>
  <li>"customer" table(customer_name, customer_street, customer_city)</li>
  <li>"account" table (account_number, branch_name, balance) </li>
  <li>"loan"table (loan_number, branch_name, amount) </li>
  <li>"depositor"table (customer_name, account_number) </li>
  <li>"borrower" table (customer_name, loan_number)</li>
  </ul>
  
  <p>Now I want to find all customers who have both an account and a loan at the Perryridge branch.</p>
  
  <p>the SQL query that I wrote is </p>
  
  <pre><code>SELECT distinct customer_name 
  FROM borrower, loan
  WHERE borrower.loan_number = loan.loan_number 
        AND branch_name = 'Perryridge' 
        AND (branch_name, customer_name )     
            IN (SELECT branch_name, customer_name 
               FROM depositor, account
               WHERE depositor.account_number = account.account_number )
  </code></pre>
  
  <p>I want to know is there any other simpler SQL query can complete the same question, such as using TABLE UNION.</p>