Question: Tutorial 8 1. What is the difference between UNION and UNION ALL? Write the syntax for each. 2. What three join types are included in


Tutorial 8 1. What is the difference between UNION and UNION ALL? Write the syntax for each. 2. What three join types are included in the OUTER JOIN classification? 3. Use the database tables below. Database name: Ch08_Saleco Table name: CUSTOMER CUST_NUM CUST_LNAME CUST_FNAME CUST_BALANCE 1000 Smith Jeanne 1050.11 1001 Ortega Juan 840.92 Table name: INVOICE INV_NUM CUST_NUM INV_DATE INV_AMOUNT 1000 23-Mar-10 235.89 8001 1001 23-Mar-10 312.82 B002 1001 30-Mar-10 528.10 B00C 1000 12-Apr-10 194.78 8004 1000 619.44 23-Apr-10 Table name: CUSTOMER_2 CUST_NUM CUST_LNAME CUST_FNAME 2000 McPherson Anne 2001 Ortega Juan 2002 Kowalski Jan 2003 Chen George a. Write the query that will generate a combined list of customers (from tables CUSTOMER and CUSTOMER_2) that do not include the duplicate customer records. (Note that only the customer named Juan Ortega shows up in both customer tables.) b. Write the query that will generate a combined list of customers to include the duplicate customer records. C. Write the query that will show only the duplicate customer records. d. Write the query that will generate only the records that are unique to the CUSTOMER_2 table. 4. Use tables below to apply relational set operators: UNION, UNION ALL, INTERSECT, MINUS EMP TEST EMP ID EMP_NAME 100 James 104 Kathy EMP_ADDRESS EMP_SSN Troy 232434 Holland 324343 EMP DESIGN EMP_ID ENAME 103 Rose 102 Marry 105 Laurry 104 Kathy EMP ADDRESS SSN Freser Town 6744545 Novi 3436131 Rochester Hills 97676 Holland 324343
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
