SQL Junction
2.92K subscribers
17 photos
1 video
7 files
90 links
Download Telegram
🚨 Just Dropped!
I’ve uploaded the first video of my new YouTube series: SQL Server Interview Questions – Episode 1 🎥
👉 Watch Now

It covers a real-world SQL challenge with match results, NULLs, and detailed output logic. If you’re preparing for interviews or want to sharpen your SQL problem-solving skills, don’t miss this breakdown.

💬 I’d love to hear your version of the solution in the comments. Let’s learn from each other!

🙏 I’m on a mission to reach 500 subscribers and build a strong SQL & Data community on YouTube.
If you’ve found value in SQL Junction, I truly need your support now more than ever.

🎯 Please:
1️⃣ Watch the video
2️⃣ Like + Comment your thoughts
3️⃣ Hit Subscribe if you haven’t already
🔗 https://youtu.be/inJ85gOS078

Thanks for being part of this journey. Let’s grow together! 🚀

#SQLJunction #SQLServer #SQLInterview #SQL
🚨 New YouTube Video Just Dropped!
🎯 Amazon SQL Interview Question Solved!

🟣 Learn how to calculate month-over-month percentage change in revenue — a real SQL question asked in Amazon interviews!
📺 Watch Now 👉

https://youtu.be/WrRA-hVDZ5I

📌 Don’t forget to: 🔗 Subscribe to the channel 💬 Drop your thoughts in the comments 📣 Share with friends preparing for data interviews!

Please help me in reaching 500 subscribers.

#SQL #AmazonInterview #DataAnalytics #SQLInterview #SQLJunction
❤1
🚨 SQL Challenge — Real-World Use Case

You’re given a log table with 3 columns:
📅 record_date,
🏦 account_id,
👤 user_id

Task:
🔍 For each account, identify users who came back after 7+ days of inactivity.

Sounds simple, right?
But to solve this, you’ll need to:

* Use LAG() to compare login dates
* Calculate gaps between logins per user
* Filter only those who returned after 7+ days
* Do all of this per account, not globally

This is exactly the kind of logic you’ll face in interviews and real projects.

Here’s the SQL solution 👇

🧠 SQL Solution:


WITH user_logins AS (
SELECT
account_id,
user_id,
record_date,
LAG(record_date) OVER (
PARTITION BY account_id, user_id
ORDER BY record_date
) AS prev_login
FROM user_activity_log
),
login_gaps AS (
SELECT *,
DATEDIFF(day, prev_login, record_date) AS gap_days
FROM user_logins
)
SELECT DISTINCT
account_id,
user_id
FROM login_gaps
WHERE gap_days >= 7;

📩 For more such real-world SQL questions?
Join the LinkedIn posts and weekly YouTube drops:
🔗 https://www.youtube.com/playlist?list=PLU1HobJd_JCqjcZwUCc6s8avJutoIjyIF

📌 Stay tuned here for more!

#SQL #DataEngineering #InterviewPrep #SQLInterview
🚨 New Video Just Dropped!

📺 Just uploaded a fresh YouTube video where I break down a Hard Google SQL interview question:

🎬 Compare the rating of an actor’s most recent film with the average of all their previous films.

If you’re preparing for SQL interviews or just want to level up your logic — this is a must-watch!

📌 Watch here: https://youtu.be/gZ7ZKtKvL7s
🔥 Don’t forget to like, comment, and share if it helps!

Please help me in reaching 500 subscribers, Guys!!

#SQLJunction #SQLInterview #Google #DataEngineering #InterviewPrep #DataJobs
Average SQL vs Great SQL.pdf
169.7 KB
🚫 Most developers write SQL like this...
✅ But great developers write it like this.

Just shared a visual breakdown of common SQL mistakes — and how to fix them like a pro! ⚡

Perfect for anyone preparing for interviews or writing SQL daily.

📌 Upgrade your query game in 60 seconds.

#SQL #InterviewPrep #SQLTips #SQLJunction #SQLInterview
❤2
🚀 SQL Challenge #14 — The Lift Capacity Problem is LIVE!



You’re given two tables — LIFT and LIFT_PASSENGERS.
Multiple passengers can try to enter the same lift, but the total passenger weight cannot exceed the lift’s capacity.

Your task?
👉 Write an SQL query that returns a comma-separated list of passengers who can fit into each lift without exceeding capacity, ordered by their weight in ascending order.


In this video, I’ll walk you through my entire step-by-step solution in SQL Server, breaking down the logic clearly so you can learn, understand, and apply it in your own interviews 💼

🎥 Watch the full video here:
👉 https://youtu.be/8e-e1xYsgG0
https://youtu.be/8e-e1xYsgG0


💬 Drop your approach in the comments — let’s see how you solved it differently!
👥 Share this with your SQL buddies who love a good challenge.


#SQLChallenge #SQLServer #SQLQuery #SQLInterview #SQLPractice #SQLJunction #LearnSQL
😲 99% of SQL learners struggle with this problem!
You get a Club table where each member earns rewards like:
MM, CI, CO (0.5 pts each) CD, CL, CM (1 pt each)

💥 Challenge: Calculate the total points scored by each club using SQL. Sounds simple? Wait till you try it. 😏
Most people miss the key logic 👀
Can you crack it before watching the solution?
🎥 Full breakdown + solution:
👉 SQL Challenge: Calculate Total Club Points | SQL Interview Question Explained
https://youtu.be/V-mMZ4hhhQE

#SQL #SQLChallenge #DataEngineering #SQLInterview #LearnSQL
🚀 New SQL Hard Challenge is LIVE!

Today’s problem looks simple… until you try it 😅
You’re given a table of products and categories — and your task is to swap records inside each category using SQL window functions.

Most people get stuck on the logic 👀
Can YOU figure out the right approach before watching the solution?

🎥 Watch the full video here:
👉 DELOITTE HARD SQL Interview Question in Hindi | Swap records Inversely

https://youtu.be/jOrTXXleDcg

If you’re preparing for SQL interviews or just love brain-teasing SQL problems, this challenge is for you 🔥

#SQL #SQLChallenge #DataEngineering #SQLInterview #PracticeSQL
🔥1
🚀 Just shared a super useful post for anyone preparing for Data Analyst roles — especially Deloitte!

I broke down a fresh interview experience covering: • SQL scenario-based questions • Power BI practical problems • Behavioral questions you
should be ready for

If you're aiming for Deloitte or any top-tier data role, this will give you a clear idea of what to expect 👇

https://www.linkedin.com/posts/adityabansal095_deloitte-deloitteinterview-big4interviews-activity-7399760164922388480-DjaP?utm_source=share&utm_medium=member_ios&rcm=ACoAAB8c2Z8Bcu4nHPJW24bZAavnMChCO7Q0wCQ

#SQL #DataAnalyst #PowerBI #InterviewPrep
❤2