Combine Customer and Supplier Names Using UNION
📖 Scenario: You work for a company that has two separate tables: one for customers and one for suppliers. Both tables have a column called name that stores the names of people or companies.Your manager wants a single list of all unique names from both tables combined.
🎯 Goal: Create a SQL query that uses UNION to combine the name columns from the customers and suppliers tables into one list without duplicates.
📋 What You'll Learn
Use the
customers table with a name columnUse the
suppliers table with a name columnWrite a SQL query that selects
name from both tablesCombine the results using
UNION to remove duplicatesOrder the final result by
name alphabetically💡 Why This Matters
🌍 Real World
Combining data from different sources to create unified reports or lists is common in business databases.
💼 Career
Knowing how to use UNION helps database professionals merge data cleanly without duplicates, which is essential for accurate reporting.
Progress0 / 4 steps