IN with Subquery
You can use a subquery with the IN operator to filter based on a list of values returned by the inner query.
-- Find users who are in the 'admins' table
SELECT * FROM users
WHERE id IN (SELECT user_id FROM admins);
Task:
Find all users who have placed at least one order (i.e., their ID is in the orders table).