Left Column | Matching Right column |
SELECT LASTNAME FROM CUSTOMER C WHERE EXISTS (SELECT 'X' FROM CUSTOMER_SALE D WHERE TOTAL_SALE_AMOUNT < 40 AND C.CUST_ID = D.CUST_ID ) |
LASTNAME -------------- Lee |
SELECT LASTNAME FROM CUSTOMER C WHERE 2 = (SELECT COUNT(*) FROM CUSTOMER_SALE D WHERE C.CUST_ID = D.CUST_ID ) |
LASTNAME ------------- Black Lee |
SELECT LASTNAME FROM CUSTOMER C, CUSTOMER_SALE CS WHERE CS.CUST_ID = C.CUST_ID AND CS.TOTAL_SALE_AMOUNT = (SELECT TOTAL_ITEM_AMOUNT FROM CUSTOMER_SALE SALE WHERE CS.SALES_ID = SALE.SALES_ID ) |
LASTNAME --------------- Redding |
SELECT LASTNAME FROM CUSTOMER C[[delete break]] WHERE NOT EXISTS (SELECT 'X' FROM CUSTOMER_SALE SALE WHERE C.CUST_ID = SALE.CUST_ID) |
LASTNAME ------------- Laurel |
select distinct C.ParentCategory, C.SubCategory from CATEGORY C where CategoryName in (select CategoryName from BOOKSHELF where Title in (select Title from BOOKSHELF_CHECKOUT) );
select Title from BOOKSHELF_AUTHOR where Title in (select Title from BOOKSHELF where AuthorName = 'STEPHEN JAY GOULD');