Ask AI about the code you're actually writing.
No copy-pasting your code into another chat. Ask a question and AI can see the relevant code, schema, and what you're trying to do.
orders → order_items → products, then filter by product name:SELECT DISTINCT c.customer_name
FROM customers c
JOIN orders o ON o.customer_id = c.id
JOIN order_items oi ON oi.order_id = o.id
JOIN products p ON p.id = oi.product_id
WHERE p.name = 'Laptop';