🚀 SQL Learning Journey 🗓️Day 30 🌟 Topic:LeetCode Subqueries Mastery Today marks a special milestone as I dive deeper into advanced SQL concepts using subqueries through real LeetCode problems. These problems really tested my understanding of filtering, ranking, and aggregation logic! Problems Solved: 👉 Employees Whose Manager Left the Company (LeetCode 1978) Focused on identifying employees whose managers are no longer present using subqueries in WHERE clause 👉Department Top Three Salaries (LeetCode 185) Learned how to use ranking functions + subqueries to fetch top 3 salaries per department 👉 Friend Requests II - Who Has the Most Friends (LeetCode 602) Applied aggregation with subqueries to find the most connected user 👉Movie Rating (LeetCode 1341) Combined joins + subqueries + grouping to derive meaningful insights ✨Key Takeaways: →Subqueries can simplify complex filtering logic →Correlated subqueries help solve row-wise dependency problems →Ranking functions (DENSE RANK, RANK) are game-changers →Real-world SQL problems require combining multiple concepts ✨ Note: 30 days of consistency, learning, and growth in SQL! This journey is helping me think more analytically and solve problems efficiently. #SQL #LeetCode #40DaysOfCode #DataAnalytics #CodingJourney #Database #Learning
SQL Subqueries Mastery with LeetCode Challenges
More Relevant Posts
-
🚀 Deep Diving into SQL — From Experience to Mastery I’ve worked with SQL before, but recently I decided to deep dive deeper into it. And honestly… SQL is a huge ocean. Instead of getting stuck only in theory, I decided to focus on learning by doing. My approach was simple: 1️⃣ Learn or revise advanced SQL concepts and syntax 2️⃣ Practice real-world SQL problems 3️⃣ Solve challenges on LeetCode and HackerRank 4️⃣ Document everything in GitHub repositories 5️⃣ Build a SQL Cheat Sheet to make revision easier This helped me strengthen concepts like: • Joins & Aggregations • Subqueries & CTEs • Window Functions • String, Date & Numeric Functions • Query logic used in real interview problems 📌 Portfolio & Proof of Work 🌐 SQL Cheat Sheet & Learning Hub A structured reference for SQL concepts from basics to advanced. 🔗 https://lnkd.in/eUE4HXvN 💻 HackerRank SQL Practice Solutions Real SQL challenges focused on analytical queries and joins. 🔗 https://lnkd.in/e4qD-_tn ⚡ LeetCode SQL Problem Solving Practicing interview-level SQL questions to improve query logic. 🔗 https://lnkd.in/eqsSnpWJ ✍️ SQL Learning Roadmap Blog Sharing my SQL Mastery in 15 Days learning system. 🔗 https://lnkd.in/eEex3d9d If you're starting your SQL journey, feel free to use these resources as a guide. 📈 Next step: applying these skills to real-world SQL projects and data analysis case studies. Always open to connecting with people in Data Analytics / Data Engineering who are also learning and building in public. 🤝 #SQL #DataAnalytics #LearningInPublic #HackerRank #LeetCode #DataSkills #AnalyticsJourney
To view or add a comment, sign in
-
Just earned the SQL 50 badge on LeetCode 🎯 Honestly, if you’re starting with SQL - this is all you need. These 50 problems cover almost every important concept, from basics to advanced queries. Big takeaway? 👉 Window Functions are a game changer. Once you get them, a lot of “complex” problems become straightforward. If you’re preparing for interviews or strengthening your backend/data skills, I highly recommend going through this set. 📌 Want MySQL notes covering everything from basic to advanced? Check out my repository: https://lnkd.in/g8CTyMKC Consistency > Everything. #SQL #LeetCode #DataStructures #CodingJourney #BackendDevelopment #Learning #Tech
To view or add a comment, sign in
-
-
Day 29 & 30 of My SQL Learning Journey 🚀 Over the last two days, I focused on subqueries based on location. 🔹 SELECT Subquery Used when the subquery returns a single value that can be displayed in the output. 🔹 WHERE Subquery Used to filter records based on conditions from another query. 🔹 FROM Subquery Used when the result of one query is treated as a temporary table for the main query. I also practiced solving SQL LeetCode problems to strengthen my understanding: • LeetCode 185 – Department Top Three Salaries Learned how to use dense ranking and partitions to find the top salaries in each department. • LeetCode 1341 – Movie Rating Worked on joining multiple tables and using aggregate functions to identify top users and highest-rated movies. • LeetCode 602 – Friend Requests II: Who Has the Most Friends Understood how to combine sender and receiver data to count total friendships. • LeetCode 1978 – Employees Whose Manager Left the Company Learned to use subqueries and conditions to identify employees whose managers are no longer in the company. These problems helped me improve my understanding of joins, aggregate functions, ranking functions, and subqueries in real-time scenarios. #SQL #MySQL #LeetCode #DataAnalytics #SQLLearning #Subqueries #LearningJourney #DatabaseManagement #AspiringDataAnalyst
To view or add a comment, sign in
-
-
‼️ The JOIN nobody teaches you in tutorials: LATERAL JOIN ‼️ Every SQL tutorial teaches you INNER JOIN and LEFT JOIN. Nobody talks about LATERAL JOIN 🤯 I stumbled across it while trying to solve a problem that was turning my subqueries into a mess. Here’s what it does and when you actually need it 👇 ――― 🔍 The problem it solves Imagine a customers table and an interactions table. You want the last 3 interactions per customer — not just the latest one. Most people try something like this 👇 ❌ THE MESSY WAY SELECT c.customer_id, (SELECT event_type FROM interactions i WHERE i.customer_id = c.customer_id ORDER BY created_at DESC LIMIT 1) AS last_event FROM customers c; This works for 1 row. But getting the last 3? You’d need 3 subqueries 😵 It breaks down fast. ――― ⚡ LATERAL JOIN to the rescue ✅ CLEAN APPROACH SELECT c.customer_id, i.event_type, i.created_at FROM customers c JOIN LATERAL ( SELECT event_type, created_at FROM interactions WHERE customer_id = c.customer_id ORDER BY created_at DESC LIMIT 3 ) i ON true; 💡 LATERAL means: For each row in customers, run this subquery using that row’s values. 👉 It’s basically a for-loop inside SQL ――― 🚀 Why this matters at scale In real-world systems, this pattern shows up everywhere: • Last N orders per user 📦 • Top 5 products per category 🛒 • Recent activity per account 📊 👉 LATERAL JOIN handles all of them cleanly No repeated subqueries ❌ No messy self-joins ❌ No Python post-processing ❌ ――― 🧠 Where it works ✔ PostgreSQL ✔ BigQuery (as CROSS JOIN LATERAL) ✔ Redshift ✔ Most modern databases ――― 🔥 Day 2 done. 28 to go. #SQL #LearningInPublic #DataEngineering #SQLTips #TechLearning #CareerGrowth #30DayChallenge #PostgreSQL #AdvancedSQL #DataAnalytics
To view or add a comment, sign in
-
🚀 Master SQL from Basics to Advanced — In One Playlist! Struggling to connect SQL concepts together? This curated playlist by CodeQueryHub brings everything into one structured journey — from fundamentals to real-world problem solving. 🎯 What’s covered (21 power-packed videos): ✔️ DDL & DML (core foundation) ✔️ Functions & Operators ✔️ CASE Statements (real logic building) ✔️ Subqueries (step-by-step clarity) ✔️ Joins & Union (data combining mastery) ✔️ Window Functions (advanced analytics made simple) 💡 Designed for: • Beginners starting SQL • Students preparing for interviews • Professionals refreshing concepts No unnecessary theory. Just clear explanations + practical use cases. 📌 Start learning here: https://lnkd.in/gGkwr8Ta Consistency > Complexity. One playlist. Real understanding. --- #SQL #LearnSQL #SQLTutorial #DataAnalytics #DataScience #Database #SQLForBeginners #SQLQuery #Coding #Programming #TechLearning #DataEngineer #BusinessAnalytics #Analytics #LearnToCode #CodingJourney #DataSkills #InterviewPreparation #TechCareer #SoftwareDevelopment #Developers #ITSkills #QueryLanguage #DataLearning #CareerGrowth #Upskill #OnlineLearning #Education #SQLServer #MySQL #PostgreSQL #WindowFunctions #Subqueries #Joins #DDL #DML
To view or add a comment, sign in
-
-
Now I have fully understood about the #SQL and how it is important in the #DataDomain i.e (#DataEngineering, #DataAnalyst, #DataSciencist). In simple analogy: Imagine thinking of this as a Restaurant where the distributor #DataEngineer collects the ingredients from different places into one platform like #DatawareHouse to collect the data from different sources (e.g., #APIs, #WebScraping, #Databases, #Streaming others). After collecting #data using #ETL techniques/method then the #dataAnalyst clean the data find #patterns, #Key #insights like as #mining to remove #Gold from #earth #matter to make #bussiness #understanding decision making from this Insights and #DataScientist make #Ml #models to #prediction the next possible situations or #Recommendations. So, here the #SQL take vital key role to #connect the #dots between these #roles using tools #PowerBi #tableau #excel # dashboards. Let me explain it in simple words: SQL is how data professionals talk to data. It’s the language that helps you find answers, spot patterns, and turn raw tables into insights. No matter what tool you use — Power BI, Tableau, or #Python — it all starts here. SQL is the foundation that connects everything together. Learning SQL isn’t about writing commands — it’s about seeing how data moves, connects, and tells a story. Actually I learned from my #virtual #mentor is none other than Data With Baraa . Baraa Khatib Salkini . YouTube source Link 🔗: https://lnkd.in/gDx9xcus. #Data #Ai #learner #python #developer #student #ml #DataWithBaraa
SQL Full Course for Beginners (30 Hours) – From Zero to Hero
https://www.youtube.com/
To view or add a comment, sign in
-
🚀 Building something for the SQL learners out there — I'm starting an SQL Series! Whether you're a complete beginner or someone looking to sharpen your database skills, this series is for YOU. SQL is one of the most in-demand skills in tech today — whether you're in data analytics, backend dev, or just getting started with databases, understanding SQL opens doors. 📚 Here's what we'll be covering: 🔹 SELECT Mastery 🔹 JOINs (INNER, LEFT, RIGHT & FULL) 🔹 GROUP BY & Aggregates 🔹 CASE WHEN 🔹 Subqueries 🔹 CTEs & Recursive Queries 🔹 Window Functions 🔹 String Functions 🔹 DateTime Functions 🔹 NULL Handling 🔹 Views & Materialized Views 🔹 Indexes & Performance 🔹 Constraints 🔹 Transactions & ACID 🔹 JSON in MySQL 🔹 JSON in PostgreSQL 🔹 PostgreSQL vs MySQL vs Aurora 🔔 Follow me. Let's learn together. 💡 Drop a 🙋 in the comments if you're joining the series! #SQL #SQLSeries #Database #DataAnalytics #DataEngineering #LearnSQL #TechCommunity #Programming
To view or add a comment, sign in
-
**Day 9 of my 30 Days SQL Series 🚀** Today’s question was “Not Boring Movies” from LeetCode. At first, it looked like a simple filtering problem, but while solving it, I got stuck on a small concept. --- ### 💡 What the question was asking: We were given a table of movies with: * id * movie name * description * rating And we had to: 👉 select movies with **odd IDs** 👉 remove movies where description = **"boring"** 👉 sort the final result by **rating (highest first)** --- ### 😵💫 Where I got stuck: The condition for odd IDs was: `id % 2 = 1` I didn’t understand: 👉 why we are dividing by 2 👉 and what `%` actually does --- ### 🧠 What I understood: `%` is the **modulo operator**, which gives the remainder after division When we divide numbers by 2: * Even numbers → remainder = 0 * Odd numbers → remainder = 1 👉 So: `id % 2 = 1` means selecting **only odd IDs** --- ### ⚙️ Approach: * Used `% 2 = 1` to filter odd IDs * Removed rows where description = 'boring' * Sorted results using `ORDER BY rating DESC` --- ### 🧠 What I learned today: * `%` is not something to memorize, it’s a **logic to identify patterns** * Using 2 helps check even/odd, but `%` can be used with any number * Even simple questions can teach small but important concepts --- Today’s problem was easy, but it helped me understand the logic behind something I was just applying before. Learning step by step… 💪 #Day9 #SQL #LearningInPublic
To view or add a comment, sign in
-
-
📅 Day 1 out of 100 — Solving SQL Problems Daily 🚀 #100DaysOfCode 📘 Focus: SQL | Data Analytics | Problem Solving 📈 One Question a Day → 100 Days of Consistency What started as a small habit turned into a powerful learning journey. Solving SQL problems daily helped me strengthen my fundamentals and think more logically about data. 💡 What I gained from this journey: Strong understanding of JOINs, Subqueries & Aggregations Improved query optimization & thinking approach Confidence in solving real-world data problems 🔍 Sample Problem: LeetCode 175. Combine Two Tables 👉 Task: Retrieve first name, last name, city, and state for every person. If no address exists, return NULL. 👉 Solution: SELECT p.firstName, p.lastName, a.city, a.state FROM Person p LEFT JOIN Address a ON p.personId = a.personId; 🧠 Key Learning: Using LEFT JOIN ensures all records are included, even when matching data is missing. Consistency really compounds. From writing basic SELECT queries to confidently solving real problems—this journey was worth it. Not stopping here… next goal: Advanced SQL + Real-world datasets + Analytics projects 📊 If you're thinking of starting, just begin with 1 question today. #SQL #DataScience #100DaysOfCode #Learning #Consistency #GenZEngineers #LeetCode
To view or add a comment, sign in
-
-
🚀 Day 29 of My SQL Journey – Subqueries (Part 4) Today I explored how subqueries can be used based on their location in SQL queries 📊 Instead of just learning types, I focused on where exactly we can use subqueries: 🔹 Subquery in SELECT Used to display calculated values alongside each row 👉 Example: Showing each customer with overall average amount 🔹 Subquery in WHERE Used for filtering based on conditions 👉 Example: Finding customers with second highest salary or matching categories 🔹 Subquery in FROM (Derived Table) Used to create a temporary table for further querying 👉 Example: Calculating average sales per store and using it as a table 🔹 Subquery in HAVING Used to filter grouped results based on aggregate conditions 👉 Example: Finding stores with transaction count less than overall transactions 💡 Key Takeaway: Subqueries are powerful because they help break complex problems into smaller steps and allow placing logic exactly where it's needed. 📈 Slowly moving from basic queries to writing more optimized and structured SQL! #SQL #LearningJourney #Day29 #Subqueries #Database #Coding #Tech #StudentDeveloper
To view or add a comment, sign in
-
Explore related topics
- Leetcode Problem Solving Strategies
- How to Solve Real-World SQL Problems
- LeetCode Array Problem Solving Techniques
- SQL Learning Resources and Tips
- SQL Learning Roadmap for Beginners
- SQL Mastery for Data Professionals
- How to Use SQL QUALIFY to Simplify Queries
- How to Master SQL Techniques
- Topics to Study for SQL Interviews
- How to Understand SQL Query Execution Order
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