SQL UNION Exercises: Display all the salesmen and customer involved in this inventory management system
SQL UNION: Exercise-3 with Solution
3. Write a query to display all the salesmen and customer involved in this inventory management system.
Sample table: orders
Sample table: customer
SELECT salesman_id, customer_id FROM customer UNION (SELECT salesman_id, customer_id FROM orders)
salesman_id customer_id 5005 3001 5007 3003 5001 3007 5002 3008 5006 3004 5003 3009 5001 3002 5002 3005
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?