Customer Who Visited but Did Not Make Any Transactions | Leetcode 1581 | Crack SQL Interviews

  Рет қаралды 4,743

Learn With Chirag

Learn With Chirag

Күн бұрын

Want to crack SQL interviews? Check out our latest video !!!
A 50-questions SQL study plan to ace any interview.
This tutorial will walk you through the solution in easy steps. This is an easy-level question from Leetcode.
Consistency is what transforms average into excellence.
So be consistent & keep Coding💻!!
SQL Study Plan : leetcode.com/s...
SQL Playlist: • Crack SQL Interview in...
Timecodes
0:00 - Introduction
0:26 - Question Explanation
2:30 - Understanding Concept with the help of Example
5:11 - Writing SQL Query
7:03 - Explanation of the Query
8:40 - Outro
Connect With Me -
Instagram: / createwithc. .
Email: chiragsehgalchirag@gmail.com
#mysql
#sql
#leetcode
#sqlinterviewquestionsandanswers
#sqlserver
#top50
#coding
#customer
#interview
#google
#amazon
#microsoft

Пікірлер: 21
@learnwithchirag
@learnwithchirag 8 ай бұрын
Few Test Cases were changed in the question after I made my video..... So if the above solution is giving a wrong answer when submitted then kindly change "t.transaction_id to t.amount" in the WHERE clause. So the new solution will be - ----------------------------------------------------------------------------------------------------------- SELECT v.customer_id, COUNT(v.visit_id) AS count_no_trans from Visits v LEFT JOIN Transactions t ON v.visit_id = t.visit_id WHERE t.amount IS NULL GROUP BY v.customer_id; -------------------------------------------------------------------------------------------------------------
@prathamsrivastava3153
@prathamsrivastava3153 7 ай бұрын
sir even the updated solution is not getting accepted..please check and help
@learnwithchirag
@learnwithchirag 7 ай бұрын
​@@prathamsrivastava3153 Hi pratham , They might have updated the test cases again. This can be done by sub queries method which I have taught later in this series- ---------------------------------------------------------------------------------------------------------------- SELECT customer_id, COUNT(visit_id) as count_no_trans FROM Visits WHERE visit_id NOT IN ( SELECT visit_id FROM Transactions ) GROUP BY customer_id ---------------------------------------------------------------------------------------------------------------- Or this way - ---------------------------------------------------------------------------------------------------------------- SELECT customer_id, COUNT(visit_id) as count_no_trans FROM Visits v WHERE NOT EXISTS ( SELECT visit_id FROM Transactions t WHERE t.visit_id = v.visit_id ) GROUP BY customer_id ---------------------------------------------------------------------------------------------------------------- WIll make a video on it in future whenever i get time ! To understand this solution you may complete the series once and then come back to this question again.
@prathamsrivastava3153
@prathamsrivastava3153 7 ай бұрын
Thank you so much sir@@learnwithchirag
@prathamsrivastava3153
@prathamsrivastava3153 6 ай бұрын
select customer_id,count(customer_id)as count_no_trans from Visits as v left join Transactions as t on v.visit_id=t.visit_id where transaction_id is null group by customer_id All cases accepted👍👍
@learnwithchirag
@learnwithchirag 5 ай бұрын
Hey there! 👋 For more interesting content, tutorials, and updates, Feel free to connect with me on Instagram Handles :- @createwithchirag - instagram.com/createwithchirag/ @learn.with.chirag - instagram.com/learn.with.chirag/ LinkedIn: www.linkedin.com/in/chirag-sehgal-9200111b8/ Let's stay connected and keep the creativity flowing! 💡
@RaghunathGhate-e2c
@RaghunathGhate-e2c Ай бұрын
Started following you from yesterday and i feel that your videos are great and i am feeling confident now ...thank you so much and please make content related to big data.
@Apna_tahlka_123
@Apna_tahlka_123 25 күн бұрын
Aap leetcode k python series bhi bnao in hindi pandas ki bhi bhot ach smjhaya thank
@priyanshupatel02
@priyanshupatel02 6 ай бұрын
one of the best explanation bhai, best thing about liking ur explanation is that you gave reason behind using keywords. keep it up!!
@learnwithchirag
@learnwithchirag 6 ай бұрын
Thank you so much ! Keep watching, more good content to come 💯🎉
@creativeideas4170
@creativeideas4170 Ай бұрын
thankyou sir ypur work is very excellent
@learnwithchirag
@learnwithchirag Ай бұрын
So nice of you. Do share with your friends too 💯💐
@amankumar-ig2fe
@amankumar-ig2fe 5 күн бұрын
why we put transaction id null
@MohammedHasmi577
@MohammedHasmi577 8 ай бұрын
Bhai literally great explanation thanks allah pak give you more success in your life
@learnwithchirag
@learnwithchirag 8 ай бұрын
Glad it was helpful to you! Many more things to come in future. So Keep Watching 💯
@SumeshGupta
@SumeshGupta Ай бұрын
@learnwithchirag Thanks for wonderful explanation after watching question how to know here we have to use left join?
@hritiksharma919
@hritiksharma919 2 ай бұрын
nice explanation 10 out of 10 points for you
@learnwithchirag
@learnwithchirag 2 ай бұрын
So nice of you... Keep watching and share with your friends too 💐💯
@ShivamGupta-io7en
@ShivamGupta-io7en 5 ай бұрын
Really Nice.
@learnwithchirag
@learnwithchirag 5 ай бұрын
Thank you! Cheers🎉
8. Customer Who Visited but Did Not Make Any Transactions | SQL Leetcode
10:20
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 14 МЛН
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 48 МЛН
女孩妒忌小丑女? #小丑#shorts
00:34
好人小丑
Рет қаралды 17 МЛН
路飞太过分了,自己游泳。#海贼王#路飞
00:28
路飞与唐舞桐
Рет қаралды 43 МЛН
The 25 SQL Questions You MUST Know for Data Analyst Interviews
32:47
KSR Datavizon
Рет қаралды 212 М.
LeetCode 1581 Interview SQL Question with Detailed Explanation | Practice SQL
7:11
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 124 М.
SQL Joins: Difference Between Inner/Left/Right/Outer Joins
10:52
7 Database Design Mistakes to Avoid (With Solutions)
11:29
Database Star
Рет қаралды 71 М.
LeetCode Medium 1934 Interview SQL Question with Detailed Explanation
11:47
Everyday Data Science
Рет қаралды 6 М.
EVOLUTION OF ICE CREAM 😱 #shorts
00:11
Savage Vlogs
Рет қаралды 14 МЛН