ComenzarEmpieza gratis

Interrogating with INTERSECT

INTERSECT and EXCEPT are very useful for data interrogation.

The Earthquakes and NBA Season 2017-2018 databases both contain information on countries and cities. You are interested to know which countries are represented by players in the 2017-2018 NBA season and you believe you can get the results you require by querying the relevant tables across these two databases.

Use the INTERSECT operator between queries, but be careful and think about the results. Although both tables contain a country name column to compare, these are separate databases and the data may be stored differently.

Este ejercicio forma parte del curso

Improving Query Performance in SQL Server

Ver curso

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

SELECT CountryName 
FROM ___ -- Table from Earthquakes database

___ -- Operator for the intersect between tables

SELECT Country
FROM ___; -- Table from NBA Season 2017-2018 database
Editar y ejecutar código