Find out the highest and lowest salaried employee from each dept | Data Engineering Interview | LTI

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • If you like this video please do like,share and subscribe my channel.
    PySpark playlist : • PySpark and Databricks
    PySpark RealTime Scenarios playlist : • PySpark Real Time Scen...
    PySpark Interview Question : • PySpark Interview Series
    Linkedin : / pritam-saha-060516139
    Contact Mail Id : pritamsaha2708@gmail.com
    Telegram channel : t.me/Cognitive...
    Topmate : topmate.io/pri...
    WhatsApp channel : whatsapp.com/c...
    Instagram : / pritamsaha627
    Travel & Food Vlogs : / @pritamsaha627
    1 Subscriber, 1👍🏻, 1Comment = 100 Motivation 🙏🏼
    🙏🏻Please Subscribe 🙏🏼
    #pyspark #databricks #interview #questions #cognitivecoders

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

  • @CognitiveCoders
    @CognitiveCoders  8 หลายเดือนก่อน

    For dataset please join our telegram channel.
    t.me/CognitiveCoders

  • @krishna-mx1dx
    @krishna-mx1dx 8 หลายเดือนก่อน

    good logic and well explained, thanks

    • @CognitiveCoders
      @CognitiveCoders  8 หลายเดือนก่อน

      Thanks. Please do like, share and subscribe for supporting us

  • @sravankumar1767
    @sravankumar1767 8 หลายเดือนก่อน

    Nice explanation 👌 👍 👏

    • @CognitiveCoders
      @CognitiveCoders  8 หลายเดือนก่อน

      Thanks. Please do like, share and subscribe for supporting us.

  • @rahuldave6699
    @rahuldave6699 7 วันที่ผ่านมา

    query = spark.sql("""with cte as (select dept_id,emp_name,salary, row_number() over(partition by dept_id order by salary desc, emp_name) as rn,
    count(dept_id) over (partition by dept_id order by dept_id) as dept_count from emp
    )
    select dept_id,max(case when rn = 1 then emp_name else Null end ) as max_salary,
    min(case when rn = dept_count then emp_name else Null end) as min_salary
    from cte group by dept_id""")