UNION
SELECT with a UNION
In this exercise we will query the suppliers and customers table and combine the result sets while removing duplicates it finds.
SELECT company_nameFROM suppliersUNIONSELECT company_nameFROM customers;Run in terminal
This query should return 120 rows
SELECT with a UNION ALL
In this exercise we will query the suppliers and customers tables and combine the result sets without removing duplicates if they exist.
SELECT company_nameFROM suppliersUNION ALLSELECT company_nameFROM customers;Run in terminal
This query should return 120 rows
SELECT with a UNION and ORDER BY
In this exercise we will query the suppliers and customers tables, combine the result sets without removing duplicates if they exist and ordering them in descending order.
SELECT company_nameFROM suppliersUNION ALLSELECT company_nameFROM customersORDER BY company_name DESCRun in terminal
This query should return 120 rows