# @aartii.py on Instagram

- **Type:** Video
- **Original URL:** https://www.instagram.com/p/DSce0dZDVZW
- **Gondola URL:** https://gondola.cc/posts/59916252-aartiipy-instagram
- **Thumbnail:** https://img.gondola.cc/tr:w-,h-,fo-auto/postThumbnails/58f1e6a008.jpg
- **Posted:** 2025-12-19T12:28:05.000+00:00
- **Account Owner:** Aarti Sinha (@aartii.py) — https://gondola.cc/aartii.py

## Caption

Day 1/7 - SQL Challenge 🎯
TODAY’S QUESTION:
Find all customers who have made purchases over $100.
TABLES:
Customers (id, name, email)
Orders (id, customer_id, amount, order_date)
THE SOLUTION:
sqlSELECT DISTINCT c.name
FROM Customers c
JOIN Orders o ON c.id = o.customer_id
WHERE o.amount > 100;
WHY THIS MATTERS:

Tests basic JOIN understanding
DISTINCT is crucial (one customer can have multiple orders)
30% of candidates forget DISTINCT in interviews

COMMON MISTAKES:
❌ Forgetting DISTINCT (returns duplicate customers)
❌ Using WHERE instead of ON for join condition
❌ Not aliasing tables (makes query harder to read)
ALTERNATIVE SOLUTION (using IN):
sqlSELECT name
FROM Customers
WHERE id IN (
 SELECT DISTINCT customer_id
  FROM Orders
  WHERE amount > 100
);
INTERVIEW TIP:
Always ask: “Should I return duplicate names or unique names?” Clarify before coding.
Day 1/7 complete ✅
Comment ‘DONE’ when you solve it!
#SQLChallenge #Day1 #DataScience #SQL #TechInterview FAANG

## Stats

- **Views:** 4,088
- **Likes:** 382
- **Shares:** 0
- **Comments:** 18

## Tags

sqlchallenge, day1, sql, techinterview, datascience

---
Copyright (c) Gondola