Skip to main content
SQL • LESSON 164

INTERSECT

How can we find emails present in both customer and subscriber tables?

Advanced3 Minutes1770 XP
🤔 THE QUESTION

How can we find emails present in both customer and subscriber tables?

💡 WHAT IS IT?

INTERSECT returns only the distinct rows that appear in both query result sets.

🎯 WHAT IS IT USED FOR?

Finding overlap between customer lists and newsletter subscribers, shared account audits.

💻 EXAMPLE
SELECT email
FROM customers
INTERSECT
SELECT email
FROM subscribers;

🎯 Mission Objectives

Practice typing production-grade SQL code for INTERSECT.

  • INTERSECT operator
  • Set intersection
  • Shared record discovery
  • List overlap