15 SQL interview question- 8 | Data Engineer Interview

Поделиться
HTML-код
  • Опубликовано: 5 янв 2025

Комментарии • 6

  • @PrashantKumar-wz3ex
    @PrashantKumar-wz3ex Месяц назад +1

    great keep going

  • @parthchauhan9305
    @parthchauhan9305 Месяц назад +1

    This is my solution to the problem, without using join and with using just 1 cte: -
    with cte as (
    SELECT
    * ,
    FIRST_VALUE(order_date) OVER(partition by customer_id order by order_date) as first_ord
    FROM customer_orders
    )
    select
    order_date
    ,SUM(case when order_date = first_ord then 1 else 0 end) as new_customer
    ,SUM(case when order_date != first_ord then 1 else 0 end) as repeated
    from cte
    group by order_date

  • @Joker-vl7qr
    @Joker-vl7qr Месяц назад

    My SQL or Ms SQL which Should I learn ?

    • @learnbydoingit
      @learnbydoingit  Месяц назад +1

      Almost same learn sql server we have dedicated playlist..

    • @Joker-vl7qr
      @Joker-vl7qr Месяц назад

      @learnbydoingit ok bro