💥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
Sharpening SQL skills on LeetCode with problem 1757
More Relevant Posts
-
🚀 Day 25/100 – SQL LeetCode Challenge ✅ Problem Solved: Customer Placing the Largest Number of Orders Today, I worked on an SQL problem where I needed to find the customer who placed the maximum number of orders from a given table. 💡 What I learned today: How to use GROUP BY to group data based on a column Using COUNT() to calculate total occurrences Sorting results using ORDER BY Limiting results with LIMIT to get the top record Understanding how to identify maximum values in SQL 🧠 Approach: I grouped the orders by customer_number, counted the number of orders for each customer, sorted them in descending order, and selected the top result. ✨ Key takeaway: Breaking problems into smaller steps makes SQL queries much easier to understand and solve. #Day25 #LeetCode #SQL #100DaysOfCode #LearningJourney
To view or add a comment, sign in
-
-
Solving the SQL 50 challenge on LeetCode has been an exciting and confidence-boosting journey. Each problem pushed me to think deeper, optimize queries, and strengthen my understanding of SQL concepts. From basic queries to advanced topics like joins, aggregations, subqueries, and window functions — this journey was truly enriching 💡 📘 What’s in my notes/document? A structured study guide covering: All 50 problems with solutions Clear explanations for each query Key SQL concepts like SELECT, JOINs, Aggregations, Window Functions, and more Practical patterns and best practices for real-world scenarios Once you get a solid grip on fundamentals, problems labeled medium or even hard start feeling like easy. It’s all about consistency and practice. #SQL #LeetCode #DataEngineering #LearningJourney #sql50
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
-
-
Stop writing "Spaghetti SQL" 🍝.... Everyone has opened a SQL script and finded a mountain of nested subqueries that make you ill. In that cenario changes become risky, and debugging feels like a nightmare. That’s why CTEs (Common Table Expressions) come in to save everyones sanity. As shown in the infographic, a CTE allows you to define a temporary result set that you can reference within your main query. I think of it as creating a "lable" for your data. Here is some reasons for use CTEs in every complex pipeline: ✅ Readability: It breaks down complex logic into sequential, logical steps. You read it from top to bottom, like a story. ✅ Reusability: Define a complex calculation once and reference it multiple times in the same query. No more Copy-Paste! ✅ Maintainability: Need to update the logic? You only change it in one place (the WITH clause), and it propagates everywhere. ✅ Debugging: You can quickly test individual blocks of your query before running the whole thing. How has using CTEs changed the way you write SQL? Let’s discuss in the comments! 👇 #SQL #DataEngineering #Analytics #DataScience #CodingTips #Database #CleanCode #TechCommunity #DataAnalytics
To view or add a comment, sign in
-
-
🚀 Day 33/100 – SQL Practice (LeetCode) Today I worked on the problem “Find Followers Count” and strengthened my understanding of SQL aggregation. 🔹 What I Learned: Using GROUP BY to organize data effectively Applying COUNT() to calculate total values Understanding relationships between columns (user & followers) Writing clean and readable SQL queries Sorting results using ORDER BY for better clarity 🔹 Key Concept: Each user_id can have multiple follower_ids. By grouping data based on user_id, we can easily count the number of followers for each user. 🔹 SQL Solution: SELECT user_id, COUNT(follower_id) AS followers_count FROM Followers GROUP BY user_id ORDER BY user_id; 💡 Takeaway: Mastering simple problems builds a strong foundation in SQL. Small consistent efforts lead to big improvements over time! #Day33 #100DaysOfCode #SQL #LeetCode #DataLearning #PlacementPreparation
To view or add a comment, sign in
-
-
🚀 LeetCode Challenge – Day 18 (MySQL) Diving into hierarchical data structures using SQL! 💡 📌 Problem Solved: Tree Node 💻 Approach Used: Solved this using CASE statements + subquery: 🔹 Identified Root nodes where p_id IS NULL 🔹 Identified Leaf nodes where id is not present in parent IDs 🔹 Used subquery: id NOT IN (SELECT DISTINCT p_id FROM Tree WHERE p_id IS NOT NULL) 🔹 Classified remaining nodes as Inner nodes 🔹 Used CASE to label each node type 🧠 Key Learning: Learned how to classify hierarchical data into Root, Inner, and Leaf nodes using SQL logic and subqueries. ⚡ This concept is useful in real-world scenarios like organizational structures, file systems, and tree-based data modeling. 🔁 Building strong SQL fundamentals step by step! #LeetCode #SQL #MySQL #DataAnalytics #100DaysOfCode #CodingJourney #ProblemSolving #SQLPractice #DataStructures
To view or add a comment, sign in
-
-
🚀 Day 21/50 – LeetCode SQL Challenge (Immediate Food Delivery II) Today’s problem was slightly tricky — not too difficult, but it required careful thinking to correctly identify each customer’s first order and evaluate whether it was immediate or scheduled. 🔍 Key Learnings: • Identifying first order using MIN(order_date) • Understanding immediate vs scheduled delivery conditions • Calculating percentage using conditional aggregation • Using ROUND() to format the final result to 2 decimal places 🛠️ Skills Practiced: • GROUP BY • Subqueries / CTE • CASE WHEN • Aggregate Functions • ROUND() This problem showed that even simple-looking questions can test your fundamentals if not approached carefully. Slowly getting more comfortable with SQL logic and patterns. #Day21 #SQL #DataAnalytics #LearningJourney #LeetCode #Consistency #Growth
To view or add a comment, sign in
-
-
📊 Recently, I took some time to revisit core SQL concepts while practicing query-based problems on LeetCode. It was a great way to strengthen fundamentals like: • JOINs and subqueries • GROUP BY & aggregation • Window functions • Writing optimized queries for real-world scenarios Along with problem-solving, I also revised important database concepts such as ACID properties and Normalization, which are essential for designing reliable and scalable systems. To keep everything in one place, I’ve created a concise PDF that includes: ✔ Common SQL queries (interview-focused) ✔ Clear explanation of ACID properties ✔ Normalization concepts with examples Sharing it here in case it helps others who are preparing for SQL interviews or brushing up their basics. #SQL #LeetCode #Database #BackendDevelopment #InterviewPreparation #LearningJourney
To view or add a comment, sign in
-
SQL Progress: Logic & CASE Statements! Today I solved another Medium challenge on LeetCode. This problem was a great lesson in how to calculate percentages and rates directly in SQL. What I learned today: 1. AVG with CASE WHEN: I learned that I can use AVG(CASE WHEN condition THEN 1.0 ELSE 0.0 END) to calculate a rate. It’s a very clear way. 2. Handling NULLs in Rates: By using a LEFT JOIN between the Signups and Confirmations tables, I ensured that users with no actions are still included, and the AVG function automatically treats them as 0 if they don't meet the "confirmed" criteria. 3. Precision with ROUND: Used ROUND(..., 2) to make sure the final confirmation rate is clean and meets the required format(0.00). I would love to learn from your experience: is ther another methods cleaner? قليل مستمر خير من كثير منقطع #SQL #DataEngineering #PostgreSQL #LeetCode #100DaysOfCode #DataAnalytics #ProblemSolving
To view or add a comment, sign in
-
-
Understanding trends in data becomes much easier once LEAD and LAG functions are clear. A simple and practical explanation of SQL LEAD and LAG is now live on CodeQueryHub. This video covers: • What LEAD() and LAG() functions are • How to compare current, previous, and next rows • Using LAG() for past values and LEAD() for future values • Year-wise sales comparison • Percentage change calculation using window functions This is Part 3 of the Window Functions series. Watch here: https://lnkd.in/gJgefF-v #SQL #LeadLag #WindowFunctions #LearnSQL #SQLTutorial #SQLForBeginners #DataAnalytics #DataScience #DataAnalyst #DataEngineer #SQLQueries #SQLPractice #SQLLearning #Analytics #Database #DatabaseManagement #MySQL #PostgreSQL #OracleSQL #SQLServer #Programming #Coding #TechLearning #TrendAnalysis #GrowthAnalysis #CareerGrowth #CodeQueryHub
LEAD & LAG in SQL Explained 🔥 | Window Functions with Real Example (Part 3) #codequeryhub #sqlserver
https://www.youtube.com/
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