SQL Junction
2.92K subscribers
17 photos
1 video
7 files
90 links
Download Telegram
🚨 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
FAANG SQL Challenge: Can you solve "The Delimiter Trap"? 🧩

I just dropped a new breakdown of a classic interview problem that trips up even Senior Data Engineers.

The Task: Extract and calculate reward points from a single "messy" column (e.g., `'MM:CI:CD'`).

Why you should watch:
βœ… Learn the cleanest way to use STRING_SPLIT.
βœ… Master Conditional Aggregation (no more spaghetti code!).
βœ… Avoid the #1 over-engineering mistake candidates make in FAANG interviews.

Stop struggling with messy dataβ€”master the logic in 5 minutes.

Watch the full solution here:
πŸ‘‡πŸ‘‡πŸ‘‡
https://youtu.be/Pg5F8_ViXE8

Which one is faster for thisβ€”`STRING_SPLIT` or CROSS APPLY? Let me know in the YouTube comments! πŸš€

#SQL #InterviewPrep #DataEngineering #SQLJunction #SQLInterview
πŸ‘1
πŸš€ It’s LIVE! The SQL Marathon is finally out πŸ”₯

I’ve published a 3-hour SQL + Data Analytics video where I solve 50 real SQL questions using one YouTube Analytics dataset β€” step by step.

If you’re preparing for:
β€’ SQL interviews
β€’ Data Engineering / Analytics roles
β€’ Real-world SQL problem solving

This video will seriously level you up πŸ’ͺ

πŸ‘‰ Watch here: https://youtu.be/BmhKUI-PGrc

Let me know in the comments β€” how many questions could you solve on your own? πŸ˜„
β€” SQL Junction πŸ“Š

#DataAnalyst #SQLPractice #SQL #YouTube #SQLInterview #DataAnalytics
πŸ”₯3
🧠 Amazon SQL Interview Challenge
This is an interesting challenge ,please take a look

Ever tried applying Pythagoras theorem in SQL? πŸ˜„

You’re given triangle sides stored row-wise and your task is to identify which CombinationID forms a right-angled triangle.

πŸ“ Rule to apply:
HΒ² = PΒ² + BΒ² (longest side matters!)



If this showed up in an interview, how would you approach it?

https://www.linkedin.com/posts/adityabansal095_sql-amazon-amazoninterview-activity-7422150064292282368-fT9O

#SQL #SQLInterview #AmazonInterview #DataEngineering #Analytics #SQLChallenge
🎯 Data Engineering Interview in 30 Days? Here’s the Game Plan.

If I had an interview next month, this is exactly how I’d prepare πŸ‘‡

🧠 Strengthen the Basics
β€’ Revise core SQL concepts
β€’ Solve 20–30 recent SQL questions
β€’ Practice 20–30 Python coding problems

⚑ Spark & Big Data
β€’ Understand PySpark fundamentals
β€’ RDDs vs DataFrames vs Datasets
β€’ Practice top PySpark programs

πŸ— Data Engineering Foundations
β€’ Revise Data Warehousing concepts
β€’ Understand your project’s data model
β€’ Review cloud services used

πŸ’» Practical Knowledge
β€’ Essential Linux commands
β€’ Be ready to explain your project clearly
β€’ Know your roles & responsibilities
β€’ Understand implementation details

πŸ“š Interview Readiness
β€’ Common DE interview questions
β€’ Read interview experiences of the target company

πŸ’‘ 30 days is more than enough β€” if you prepare with focus.

Start today. Small daily effort > last week panic πŸš€

#dataengineer #jobopportunity #learning #interview #SQLInterview
❀5
🚨 Quick SQL Reality Check

Most developers think:

COUNT(*) = COUNT(Column)

But that’s not always true πŸ‘€

A single NULL value can completely change the result.

I recorded a quick 30-second Short explaining the difference with a simple example.

πŸŽ₯ Watch here:
πŸ‘‰ [Paste YouTube Shorts Link]

Trust me, this is one concept worth remembering for SQL interviews and real-world projects.

Or, if you want something more aggressive:

⚠️ SQL Interview Trap

What will these return?

COUNT(*)

COUNT(Salary)

Same answer? πŸ€”

Most people get this wrong because of NULL values.

I explained it in a quick YouTube ShortπŸ‘‡

πŸŽ₯ Watch Now:
πŸ‘‰
https://youtube.com/shorts/1rHHZmMHx6E?feature=share

Did you know the answer before watching? 😏
❀1
🚨 New SQL Shorts Alert! 🚨

Can you solve this Deloitte SQL Interview Question? πŸ‘€

🎯 Find all employees who earn more than their manager.

Sounds simple… until you actually try writing the query 😏

I’ve explained the complete logic in a quick 30-second YouTube Short.

πŸŽ₯ Watch now:
πŸ‘‰ Deloitte SQL Interview Question 🀯 | Employees Earning More Than Their Manager#sqlinterview#deloitte
https://youtube.com/shorts/D98qCDNnSdw?feature=share

Drop a πŸ”₯ if you got the answer right before watching!
πŸ‘1
πŸ”₯ New YouTube Video Alert

Can You Solve This Deloitte SQL Interview Question?

You’re given a products table where the category is available only for the first product, while the following rows contain NULL.

Beverages β†’ Coca Cola
NULL β†’ Pepsi
NULL β†’ Sprite
NULL β†’ Fanta

Snacks β†’ Lays
NULL β†’ Doritos
NULL β†’ Kurkure

🎯 Challenge:
How would you fill those NULL category values with the correct category?

πŸ’‘ Hint: Think about Window Functions πŸ‘€

This is a great SQL problem to test your understanding of NULL handling + data transformation.

πŸ‘‡ What would you use?

πŸ…°οΈ LAG()
πŸ…±οΈ LEAD()
πŸ…²οΈ LAST_VALUE()
πŸ…³οΈ ROW_NUMBER()

🎬 Solution video
Fill Missing Categories in SQL | Hard Deloitte Interview Question
https://youtu.be/IX9NBK3Yx-M
πŸš€

Check it out now and let me know in comments ,What did you learn?

#SQL #SQLInterview #Deloitte #SQLChallenge #DataEngineering #Snowflake
πŸ‘1