Target SQL Interview Question | Using Sub-query | Level - MEDIUM

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

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

  • @shubhamsoni174
    @shubhamsoni174 14 วันที่ผ่านมา +1

    thankyou, these sql problem solving videos are very helpful. please bring more such videos 🙏

  • @kritiknagar6089
    @kritiknagar6089 14 วันที่ผ่านมา +1

    Thanks for making such great videos. very insightful.🙏

  • @jadejagaming2051
    @jadejagaming2051 13 วันที่ผ่านมา +2

    make video on when to use join and when to sub query i am confused in both

  • @Manifestion_kannada
    @Manifestion_kannada 12 วันที่ผ่านมา

    Very helpful and in detail explaination

  • @florincopaci6821
    @florincopaci6821 14 วันที่ผ่านมา +1

    Hello,
    Another method is by using the exists operator:
    select s.seller_name
    from sellers s
    where not exists (select * from orders where s.seller_id=seller_id and year(sale_date)=2020);

  • @badrilalnagar9232
    @badrilalnagar9232 12 วันที่ผ่านมา

    Considering God as omnipresent and just, we will incorporate His discipline in our lives.

  • @user-hy1ce2fq8k
    @user-hy1ce2fq8k 11 วันที่ผ่านมา +2

    select seller_name from sellers where seller_name not in (select s.seller_name
    from orders o left join sellers s on o.seller_id=s.seller_id
    where year(o.sale_date) = '2020');

  • @RahulKumarBEC
    @RahulKumarBEC 14 วันที่ผ่านมา +1

    Great Video , very helpful

  • @omkarshinde8154
    @omkarshinde8154 13 วันที่ผ่านมา

    Why use left join

  • @vishalmane3139
    @vishalmane3139 13 วันที่ผ่านมา

    y nt ben

  • @tilu391
    @tilu391 13 วันที่ผ่านมา

    with cte as (select s.seller_id,s.seller_name,o.sale_date from sellers as s
    left join orders as o on
    s.seller_id=o.seller_id group by s.seller_id,s.seller_name,sale_date)
    select distinct seller_name from cte where seller_name not in ( select seller_name from cte where YEAR(sale_date)=2020);

  • @akhilsingh5251
    @akhilsingh5251 13 วันที่ผ่านมา

    Hello Here Is my solution:
    select s.seller_name from sellers S
    join
    (select seller_id from orrdes
    where seller_id not in (
    select distinct seller_id from orrdes
    where YEAR(sales_date) = 2020)) A
    on s.seller_id = a.seller_id

  • @RAHULKUMAR-px8em
    @RAHULKUMAR-px8em 10 วันที่ผ่านมา

    select S.seller_name
    from orders O inner join sellers S
    on O.seller_id = S.seller_id
    where datepart(year,O.sale_date) != 2020
    order by S.seller_name asc

  • @surajsinghrajput2168
    @surajsinghrajput2168 11 วันที่ผ่านมา

    select distinct seller_name
    from orders join sellers on orders.seller_id = sellers.seller_id
    where orders.seller_id not in (select distinct seller_id from orders where to_char(sale_date, 'YYYY') = '2020');

  • @avinashjadon4989
    @avinashjadon4989 13 วันที่ผ่านมา

    with cte1 as (
    select * from orders1 where year(sale_date) = '2020')
    SELECT S.seller_name FROM cte1 C RIGHT JOIN sellers S ON C.seller_id = S.seller_id
    WHERE C.seller_id IS NULL