Q:

Find all customers who have an account at all branches located in Brooklyn

I have some tables:
"branch" table(branch_name, branch_city, assets)
"customer" table(customer_name, customer_street, customer_city)
"account" table (account_number, branch_name, balance)
"loan"table (loan_number, branch_name, amount)
"depositor"table (customer_name, account_number)
"borrower" table (customer_name, loan_number)
Now I want to find all customers who have an account at all branches located in Brooklyn. Here is my SQL for this problem. BUT I want to know how to use TABLE JOIN, and WITHOUT USING EXCEPT to solve this problem. CAN SOMEONE HELP ME ?????THANKS.
SELECT distinct S.customer_name FROM depositor as S
WHERE not exists (
     (SELECT branch_name
      FROM branch
      WHERE branch_city = 'Brooklyn')
      EXCEPT
      (SELECT R.branch_name
       FROM depositor as T, account as R
       WHERE T.account_number = R.account_number and
             S.customer_name = T.customer_name ))

A:

I cannot come up with a way to do this using UNION. Your problem is to find a Customer that has ALL Branches in Brooklyn. Fundamentally there are two ways to go about that.

Solution 1 - Find the customers that do not not have all the branches in Brooklyn. 

(Intentional double negative). In other words, find all customers that do not have at least one of the branches in Brooklyn, then take the rest. 
This is what you are doing in your example. You take all the branches in Brooklyn EXCEPT the branches the customer has, if there are no Brooklyn branches remaining, then the customer has them all. You can do this another way using joins, though yours is probably more readable.
SELECT customer_name
FROM customer
WHERE customer_name NOT IN (
    SELECT d.customer_name
    FROM depositor d
    INNER JOIN branch brooklyn ON brooklyn.branch_city = 'Brooklyn'
    LEFT JOIN account a 
        ON d.account_number = a.account_number
        AND brooklyn.branch_name = a.branch_name 
    WHERE a.account_number IS NULL )

Solution 2 - Find all the customers that have the same number of branches in Brooklyn as there are branches in Brooklyn.

In order to do this you will need to use a GROUP BY to get the count of Brooklyn branches per customer, you can then use this to compare to the total count of branches in Brooklyn.
SELECT d.customer_name
FROM depositor d
INNER JOIN account a ON d.account_number = a.account_number
INNER JOIN branch b ON a.branch_name = b.branch_name
WHERE b.branch_city = 'Brooklyn'
GROUP BY d.customer_name
HAVING COUNT(DISTINCT B.branch_name) = (
    SELECT COUNT(branch_name)
    FROM branch 
    WHERE branch_city = 'Brooklyn')

A UNION is used to combine two datasets. If your question was...

"Find all customers that have an account or a loan from a branch in Brooklyn."

...then you could use a UNION.
SELECT DISTINCT d.customer_name
FROM depositor d
INNER JOIN account a ON d.account_number = a.account_number
INNER JOIN branch b ON a.branch_name = b.branch_name
WHERE b.branch_city = 'Brooklyn'
UNION
SELECT DISTINCT l.customer_name
FROM borrower bo
INNER JOIN loan l ON bo.loan_number = l.loan_number
INNER JOIN branch b ON l.branch_name = b.branch_name
WHERE b.branch_city = 'Brooklyn'

