SQLSQL
#8

IN vs EXISTS in SQL Subquery Filtering

Medium
Interview Question #8

You have `customers` and `orders`. Write a query to find all customers who have placed at least one order with `status = 'shipped'`. Explain whether `EXISTS` or `IN` is more robust against NULL values.

Input Table: customers
3 rows preview
customer_idname
1Aarav
2Bhavna
3Chirag
Expected Output Structure2 rows
customer_idname
1Aarav
3Chirag
Interview Context

Asked frequently in data analyst and business analyst technical rounds. Focus on clean filtering, optimal indexing usage, and unambiguous column selection.

SQLPostgreSQL 15
Ready to execute

Click "Run Query" or press Ctrl + Enter to test your query.

Output will be verified against the test dataset.

Chat with us