PracticalNo10
PracticalNo10
operations.
Step 1: Create Two Tables
First, create two simple tables, EMPLOYEES_A and EMPLOYEES_B, with
some common and some unique names.
CREATE TABLE EMPLOYEES_A (
EMPLOYEE_ID INT PRIMARY KEY,
FIRST_NAME VARCHAR2(50),
DEPARTMENT_ID NUMBER
);
UNION ALL
• Purpose: Combines the results from both tables, including
duplicates.
• Query:
SELECT FIRST_NAME FROM EMPLOYEES_A
UNION ALL
SELECT FIRST_NAME FROM EMPLOYEES_B;
Output:
MINUS
• Purpose: Returns names in the first table that are not in the second
table.
• Query:
SELECT FIRST_NAME FROM EMPLOYEES_A
MINUS
SELECT FIRST_NAME FROM EMPLOYEES_B;
Result: Amit, Rohit
Output: