MulaiMulai sekarang secara gratis

INTERSECT

INTERSECT is one of the easier and more intuitive methods used to check if data in one table is present in another.

You want to know which, if any, country capitals are listed as the nearest city to recorded earthquakes. You can get this information by comparing the Nations table with the Earthquakes table.

Latihan ini adalah bagian dari kursus

Improving Query Performance in SQL Server

Lihat Kursus

Petunjuk latihan

  • Add the table with country capital cities to the left query.
  • Add the operator that compares the two queries.
  • Add the city name column from the Earthquakes table.

Latihan interaktif praktis

Cobalah latihan ini dengan menyelesaikan kode contoh berikut.

SELECT Capital
FROM ___ -- Table with capital cities

___ -- Add the operator to compare the two queries

SELECT ___ -- Add the city name column
FROM Earthquakes;
Edit dan Jalankan Kode