INTERSECT
SELECT with an INTERSECT
In this exercise we will query the orders and country tables and return the result sets that are found in both tables.
SELECT ship_countryFROM orders INTERSECTSELECT countryFROM suppliers;Run in terminal
This query should return 12 rows
SELECT with an INTERSECT AND ORDER BY
In this exercise we will query the orders and country tables, return the result sets that are found in both tables and oder them by ship_country.
SELECT ship_countryFROM orders INTERSECTSELECT countryFROM suppliersORDER BY ship_country;Run in terminal
This query should return 12 rows