Deloitte SQL Interview Question 2024 | Cases that reached each stage of completion for each center

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ม.ค. 2025

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

  • @ishanshubham8355
    @ishanshubham8355 2 หลายเดือนก่อน +5

    I tried solving it on MYSQL
    with cte as (
    Select *,
    concat_ws(",",stage1,stage2,stage3,stage4,stage5) as cnct1,
    concat_ws(",",stage2,stage3,stage4,stage5) as cnct2,
    concat_ws(",",stage3,stage4,stage5) as cnct3,
    concat_ws(",",stage4,stage5) as cnct4,
    concat_ws(",",stage5) as cnct5
    from CaseProgress)
    select center_id,
    sum(if(length(cnct1)0,1,0)) as stage1,
    sum(if(length(cnct2)0,1,0)) as stage2,
    sum(if(length(cnct3)0,1,0)) as stage3,
    sum(if(length(cnct4)0,1,0)) as stage4,
    sum(if(length(cnct5)0,1,0)) as stage5
    from cte
    group by 1

    • @datasciencecorner
      @datasciencecorner  หลายเดือนก่อน +3

      @ishanshubham8355 Great! Keep practicing and let us know if you need any particular topic or question to make us a video on.