▸_sqlgym

61. Customers Who Bought on Both Channels (INTERSECT)

EasySet OperationsINTERSECTdeduplicationORDER BY

INTERSECT returns only the rows present in both result sets, and like the other set operators it dedupes and compares the entire row.

Task: return the customers who purchased through both the online store and the retail store.

Return a single column customer. Order by customer ascending.

Tables
Loading schema…
Expected outputrows must come back in this order
Computing expected output…

This is the result for the example data above. On Submit your query is graded against this example plus 4 hidden edge cases 5test cases in all. A sloppy query that only fits the example won't pass.

SQL
⌘/Ctrl+↵ run · ⇧⌘/Ctrl+↵ submit
Run a query to see its output here.