🚀 Day 24 – 30 Days SQL LeetCode Challenge Today’s problem felt like analyzing a real social media network 👥 📌 Today's Problem: Friend Requests II: Who Has the Most Friends (LeetCode #602) 🧠 Problem Statement: Find the person who has the highest number of friends and return their ID along with the total count. 💡 Key SQL Concepts Used: • UNION ALL • Aggregation (COUNT) • GROUP BY • ORDER BY + LIMIT 📚 What I Practiced Today: ✔ Converting relationships into a single column using UNION ALL ✔ Counting total connections (friends) ✔ Finding top results using sorting + limit 🔥 This pattern is used in: • Social networks (friends/followers) • Graph-like data problems • Recommendation systems 🔗 GitHub Repository: https://lnkd.in/e8aV37dA #SQL #LeetCode #DataAnalytics #30DaysOfSQL #LearningInPublic #SocialNetworkAnalysis
SQL LeetCode Challenge: Friend Requests Analysis
More Relevant Posts
-
🚀 Day 26 – 30 Days SQL LeetCode Challenge Today’s problem was simple but highlights an important real-world scenario 👀 📌 Today's Problem: Article Views I (LeetCode #1148) 🧠 Problem Statement: Find all authors who viewed at least one of their own articles. 💡 Key SQL Concepts Used: • DISTINCT • Filtering with conditions • Comparing columns within the same row 📚 What I Practiced Today: ✔ Comparing values within the same table ✔ Removing duplicates using DISTINCT ✔ Writing clean filtering queries 🔥 This pattern is useful in: • Detecting self-actions (self-purchases, self-views) • Fraud detection • User behavior analysis 🔗 GitHub Repository: https://lnkd.in/e8aV37dA #SQL #LeetCode #DataAnalytics #30DaysOfSQL #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Day 27 – 30 Days SQL LeetCode Challenge Almost at the finish line! 🏁 Today’s problem was a great example of real-world analytics queries 📊 📌 Today's Problem: Market Analysis I (LeetCode #1158) 🧠 Problem Statement: For each user, find: • Their join date • The number of orders placed in 2019 💡 Key SQL Concepts Used: • LEFT JOIN • Conditional aggregation (CASE WHEN) • COUNT() • GROUP BY 📚 What I Practiced Today: ✔ Conditional counting using CASE WHEN ✔ Keeping all users using LEFT JOIN ✔ Aggregating filtered data 🔥 This pattern is used in: • Business dashboards • KPI tracking • Customer activity analysis 🔗 GitHub Repository: https://lnkd.in/e8aV37dA #SQL #LeetCode #DataAnalytics #BusinessAnalytics #30DaysOfSQL #LearningInPublic
To view or add a comment, sign in
-
-
🚀 LeetCode Challenge – Day 8 (MySQL) Diving deeper into real-world business analytics with SQL! 💡 📌 Problem Solved: Trips and Users 💻 Approach Used: Solved this using JOIN + aggregation + conditional logic: 🔹 Joined Trips with Users table twice (for client & driver) 🔹 Filtered only non-banned users (banned = 'No') 🔹 Used CASE WHEN to identify cancelled trips 🔹 Calculated cancellation rate using: SUM(condition) / COUNT(*) 🔹 Applied ROUND(..., 2) to format results 🔹 Grouped data by request_at (daily analysis) 🧠 Key Learning: Learned how to calculate metrics like cancellation rate using conditional aggregation — a key concept in data analytics. ⚡ This problem reflects real-world scenarios like tracking daily performance metrics and user behavior. 🔁 Consistency + practice = better SQL intuition every day! #LeetCode #SQL #MySQL #DataAnalytics #100DaysOfCode #CodingJourney #ProblemSolving #SQLPractice #DataAnalysis
To view or add a comment, sign in
-
-
🚀 Day 28/50 #LeetCodeChallenge Today’s problem: Biggest Single Number This problem was a brilliant exercise in combining Aggregation with Subqueries to filter out duplicates effectively. 🔥 💡 Problem Insight: The task was to find the largest number that appears only once in the table. If no unique number exists, the result should be null. 🧠 Key Learning: Identify Uniqueness: Used GROUP BY combined with HAVING COUNT(*) = 1 to isolate numbers that don't repeat. The Power of MAX(): Applied MAX() on the filtered subset to grab the highest value. Handling Nulls: Using MAX() on a subquery is a clean way to ensure a null output if the criteria aren't met, instead of getting an empty result set. ⚡ Big Realization: The real trick isn't just finding the maximum—it's knowing how to exclude data that doesn't fit your constraints (duplicates) before you look for the top value. 📈 Takeaway: SQL logic is often about "layers." Filtering the noise first makes finding the answer straightforward. Consistency > Difficulty 💯 #Day28 #LeetCode #SQL #DataAnalytics #LearningJourney #CodingChallenge #50DaysOfChallenge
To view or add a comment, sign in
-
-
🚀 Day 4/30 of My LeetCode Journey (SQL Focus) Keeping the streak alive and diving deeper into SQL concepts! 📊💻 🔹 **SQL Problem of the Day** 👉 *Rising Temperature (Weather Table)* Given a `Weather` table with columns (id, recordDate, temperature), write a query to find all ids where the temperature is higher than the previous day (yesterday). 💡 *Key Concept:* Self JOIN on dates (using date difference of 1 day) to compare current and previous records. Learning how to compare rows across time using SQL joins — really powerful concept! 🔥 Consistency is the key. Let’s keep building 📈 #LeetCode #30DaysChallenge #SQL #DataAnalytics #CodingJourney #Consistency #ProblemSolving #LearnInPublic
To view or add a comment, sign in
-
🚀 LeetCode Challenge – Day 21 (MySQL) Keeping the streak alive and diving deeper into SQL problem-solving! 💡 📌 Problem Solved: Biggest Single Number 💻 Approach Used: Solved this using GROUP BY + HAVING + subquery: 🔹 Grouped numbers using GROUP BY num 🔹 Filtered only unique numbers with HAVING COUNT(num) = 1 🔹 Wrapped the result in a subquery 🔹 Used MAX(num) to find the largest unique number 🧠 Key Learning: Learned how to combine aggregation and filtering to isolate unique values and then apply functions like MAX for final results. ⚡ This type of logic is useful in real-world scenarios like finding unique high-value records or anomalies in datasets. 🔁 Step by step, building strong SQL intuition! #LeetCode #SQL #MySQL #DataAnalytics #100DaysOfCode #CodingJourney #ProblemSolving #SQLPractice #DataAnalysis
To view or add a comment, sign in
-
-
🚀 Day 29 – 30 Days SQL LeetCode Challenge Almost at the finish line! 🏁 Today’s problem wraps up key concepts with a powerful real-world analytics scenario 📌 Today's Problem: Immediate Food Delivery II (LeetCode #1174) 🧠 Problem Statement: Find the percentage of customers whose first order was delivered immediately 👉 (order_date = customer_pref_delivery_date) 💡 Key SQL Concepts Used: • Subquery (first order per customer) • GROUP BY • Conditional aggregation • Percentage calculation • ROUND() 📚 What I Practiced Today: ✔ Finding first records per group ✔ Calculating percentages ✔ Combining subqueries + aggregation 🔥 This pattern is used in: • Customer behavior analysis • Conversion metrics • Business KPIs 🎯 Almost there! 1 Day to go… What I’ve mastered so far: ✅ Joins ✅ Subqueries ✅ Window Functions ✅ Aggregations ✅ Real-world SQL problems 📌 Final push tomorrow 🚀 🔗 GitHub Repository: https://lnkd.in/e8aV37dA #SQL #LeetCode #DataAnalytics #30DaysOfSQL #Consistency #LearningInPublic
To view or add a comment, sign in
-
-
🚀 Solved: SQL Query – Cities Starting with Vowels Another step forward in my SQL journey on HackerRank! ✅ 🧠 Problem Overview: Retrieve a list of unique city names from the STATION table that start with vowels (A, E, I, O, U). 🔍 Key Learnings: Handling case-insensitive filtering in SQL Using DISTINCT to remove duplicates Understanding database-specific limitations (like no REGEXP in DB2) ⚡ This problem helped me understand how small differences in SQL dialects can impact solutions — an important skill for real-world database work. 📈 Continuously improving my skills in SQL, Data Structures, and Problem Solving. #SQL #HackerRank #Database #Coding #ProblemSolving #LearningJourney #TechSkills link of #Solution :- https://lnkd.in/gSDUAVnT
To view or add a comment, sign in
-
-
🚀 Day 11/30 of My LeetCode Journey (SQL Focus) Keeping the momentum going and diving deeper into SQL concepts! 📊🔥 🔹 **SQL Problem of the Day** 👉 *Rank Scores* Given a `Scores` table, write a query to rank the scores from highest to lowest. Rules: • Same scores share the same rank • No gaps in ranking (dense ranking) 💡 *Key Concept:* Using ranking functions like `DENSE_RANK()` (or alternative logic if not available). Understanding ranking functions is a game changer for analytical queries 📈 Day 11 done ✅ #LeetCode #30DaysChallenge #SQL #CodingJourney #Consistency #ProblemSolving #DataAnalytics #Learning
To view or add a comment, sign in
-
💥Hello mates!! (New challenges) 📌Kicking off my SQL 50 journey on LeetCode to sharpen my SQL skills Day 01 starts today! SQL 50 LeetCode (01/50): Today's problem is #1757:"Recyclable and low Fat products"👨💻 This is an Easy-level problem that focuses on filtering data using SQL condition. I used the WHERE clause to solve this problem,and it successfully passed all the test case✅️ How my solution Works: ->I used the WHERE clause to filter the records based on the given condition. ->The AND Operator ensure that only products that are both low- fat and recyclable are selected. ->Since the problem doesn't require any joins or aggregations, the query stays simple,clean and easy to understand. -> This approach reflect real-world SQL queries practices used in Data Analytics and Data Engineering task. Database Used:MySQL See you all tomorrow with another exciting LeetCode problem! #LeetCode #SQL50 #SQLQuery #DataAnalytics #Database #Coding #SQLPractice #Coding
To view or add a comment, sign in
-
Explore related topics
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development