de_notes

📚 UNION

The UNION operator is used in SQL to combine the result sets of two or more SELECT statements.
It removes duplicate rows between the combined result sets by default.


🛠️ Basic Syntax

SELECT column1, column2, ...
FROM table1
WHERE condition

UNION

SELECT column1, column2, ...
FROM table2
WHERE condition;

Example

SELECT first_name, last_name
FROM employees
WHERE department = 'Sales'

UNION

SELECT first_name, last_name
FROM employees
WHERE department = 'Marketing';

Key Points

Additional Example

SELECT city
FROM customers

UNION

SELECT city
FROM suppliers;

🎥 Video Notes


📝 Problem Description

Describe the problem, challenge, or topic discussed in a video related to SELECT FROM.
What concept was explained or what exercise was solved?


DataBase Given


💻 My SQL Code

-- Write your SQL code attempt or solution related to SQL COMMAND
SQL COMMAND

🧠 Solution Code / Explanation

SQL COMMAND

Explanation - Explain what you learned, any key takeaways, or how you solved the problem related to COMMAND._


⬅️ Previous: SELF JOIN Back to Main