If you want to have access to more free SQL problems, check out StrataScratch: stratascratch.com/?via=frederik
@julyw12913 жыл бұрын
I like the second way, pretty straightforward and easy to understand.
@mickyman7532 жыл бұрын
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
@frederikmuller2 жыл бұрын
interesting idea
@pimaniye412 жыл бұрын
subquery method is far more useful in my opinion. thank you for the video. liked 👍
@debashish_dutta2 жыл бұрын
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)
@pritishpattnaik4674 Жыл бұрын
ya got it , I was missing that AS part so getting wrong answer
@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) ;
@balaji27venkateshАй бұрын
-- efficient code select c.name as "Customers" from Customers as c left join Orders as o on c.id = o.customerId where o.id is null ---- simple to understand but not efficient code select name as "Customers" from Customers where id not in (select distinct Customerid from Orders)
@frederikmullerАй бұрын
I see you’re solving a lot of questions on this channel, keep it up.