SELECT customerNumber, customerName FROM customers WHERE EXISTS( SELECT 1 FROM orders WHERE orders.customernumber = customers.customernumber);
SELECT customerNumber, customerName FROM customers WHERE NOT EXISTS( SELECT 1 FROM orders WHERE orders.customernumber = customers.customernumber);
SELECT employeenumber, firstname, lastname, extension FROM employees WHERE EXISTS( SELECT 1 FROM offices WHERE city = 'San Francisco' AND offices.officeCode = employees.officeCode);
SELECT * FROM customers_archive;
SELECT customerNumber, customerName FROM customers WHERE customerNumber IN (SELECT customerNumber FROM orders);
SELECT customerNumber, customerName FROM customers WHERE customerNumber IN (SELECT customerNumber FROM orders);
SELECT employeenumber, firstname, lastname FROM employees WHERE officeCode IN (SELECT officeCode FROM offices WHERE offices.city = 'San Francisco');