LeetCode 183: Customers Who Never Order [SQL]

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024

ความคิดเห็น • 10

  • @frederikmuller
    @frederikmuller  2 ปีที่แล้ว

    If you want to have access to more free SQL problems, check out StrataScratch: stratascratch.com/?via=frederik

  • @julyw1291
    @julyw1291 3 ปีที่แล้ว

    I like the second way, pretty straightforward and easy to understand.

  • @pimaniye41
    @pimaniye41 2 ปีที่แล้ว

    subquery method is far more useful in my opinion. thank you for the video. liked 👍

  • @mickyman753
    @mickyman753 2 ปีที่แล้ว +1

    can you make a pattern sheet like , for similar pattern questions we can use this or that , like for this ques , pattern can be when we want first table elements not present in second then , doing left join make result table's 2nd table col null and can filter on null ,when we want to compare same column elements then self join is way to go........pattern like these would really help as when we lose touch to sql they can help us strike the inutition more

  • @pritishpattnaik4674
    @pritishpattnaik4674 ปีที่แล้ว

    ya got it , I was missing that AS part
    so getting wrong answer

  • @sandeepmanjunath8004
    @sandeepmanjunath8004 ปีที่แล้ว

    select name as customer from customers as c where not exists (select customer_id from orders as o where o.customer_id = c.id) ;

  • @debashish_dutta
    @debashish_dutta 2 ปีที่แล้ว

    3rd Approach:
    Using NOT EXISTS
    select name as "Customers" from customers cus
    where not exists (select 1 from orders ord where cus.id = ord.customerId)

  • @xt8382
    @xt8382 3 ปีที่แล้ว

    Thanks!

  • @mohit4812
    @mohit4812 2 ปีที่แล้ว

    best