SQL Interview - Employee Manager Hierarchy - Self Join

แชร์
ฝัง
  • เผยแพร่เมื่อ 17 มี.ค. 2020
  • This video is part of the series on scenario based SQL Query Interview Questions.
    This video discusses how to fetch employee manager details by implementing self joins on the same table.
    For all levels of Employee Manager Hierarchy using recursion, please see the below video
    • SQL Interview Question...
    For complete list of SQL Query Interview questions, please watch the below playlist
    • SQL Query Interview Qu...
    Please do not forget to like, subscribe and share.
    For enrolling and enquiries, please contact us at
    Website - www.knowstar.org/
    Facebook - / knowstartrainings
    Linkedin - www.linkedin.com/company/know...
    Email - learn@knowstar.org

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

  • @LearnatKnowstar
    @LearnatKnowstar  ปีที่แล้ว

    Register at the below link to get US $100 off for Coursera Plus membership between Sep 8 - Sep 29, 2022.
    The Coursera Plus membership gets you access to unlimited courses and unlimited certifications!
    imp.i384100.net/Ke51on

  • @LearnatKnowstar
    @LearnatKnowstar  4 ปีที่แล้ว +9

    Have you been asked a SQL query interview question that you couldn't answer?
    Let us know in the comments below and we will answer those in our upcoming videos!

  • @surajpatil3579
    @surajpatil3579 2 ปีที่แล้ว

    Thank you... your content is truly informative

  • @narayanagottipati5980
    @narayanagottipati5980 4 ปีที่แล้ว +1

    Great video. Please upload this type of queries mam...Thanks

  • @gagansingh3481
    @gagansingh3481 2 ปีที่แล้ว

    Thank you mam for making such an amazing videos on sql , I have practice most of your videos of playlist 62 videos ..... Keep posting amazing videos

  • @saradacosta2543
    @saradacosta2543 4 ปีที่แล้ว +1

    How will you query to identify the circular references in employees and manager relationship?

  • @ujjwaltarway1438
    @ujjwaltarway1438 ปีที่แล้ว

    WoW simply wonderful😇

  • @kristyowens2284
    @kristyowens2284 4 ปีที่แล้ว +2

    very useful. I have been asked this question many times in interviews.

  • @Sumit261990
    @Sumit261990 3 ปีที่แล้ว +1

    great video , Thanks

  • @kristidumais3458
    @kristidumais3458 4 ปีที่แล้ว

    Thank you so much!!!

  • @ravindrasutar7490
    @ravindrasutar7490 4 ปีที่แล้ว +1

    thanks its really helpful

  • @radhikasinhanwd
    @radhikasinhanwd ปีที่แล้ว

    can you help me solving a sql query for a database that contains three tables, AAID,cookies, IDAF
    Column Headers
    ● Id_type
    ○ AAID
    ○ IDFA
    ○ Cookie
    ● Device_id
    ● Hashed_email (SHA256)
    ● Timestamp
    ○ Unix timestamp
    ● Ip_address
    ● Opted_out
    ○ 1, 0
    ○ 1 = opted out
    Querys are
    ● Where device_id appears more than once AND has ID type IDFA & AAID - Delete all
    ● IF hashed email matches more than 50 IDs (sum of cookie, idfa, aaid) - Delete all
    can this be deleted in single query?

  • @AK-rw8zq
    @AK-rw8zq 4 ปีที่แล้ว +3

    The Boss who's value is Null record not appeared in the output, please check once...

    • @LearnatKnowstar
      @LearnatKnowstar  4 ปีที่แล้ว +5

      It is because of the inner join. You can change it to a Left join to get the record in the output.

  • @harshamuniswamy162
    @harshamuniswamy162 2 ปีที่แล้ว

    What is the difference between union and Superlative Union?

  • @lakshaysharma5012
    @lakshaysharma5012 ปีที่แล้ว

    Thanks for the informative video. Also, can you help with the insert code for the data?

  • @gudiatoka
    @gudiatoka 9 หลายเดือนก่อน

    left join should be better as it skip top manager id with inner join

  • @AbdullahAli-yq7wm
    @AbdullahAli-yq7wm ปีที่แล้ว +1

    If you share SQL query in the description would be so helpful

    • @LearnatKnowstar
      @LearnatKnowstar  ปีที่แล้ว

      We are sharing the queries in our most recent videos 👍

  • @PujaKiPyaariDuniya
    @PujaKiPyaariDuniya 2 ปีที่แล้ว +1

    Please make video for full hierarchy like parents ,son ,
    Grand parents , grand children

    • @LearnatKnowstar
      @LearnatKnowstar  2 ปีที่แล้ว

      Thank you for your comment. You can find it here
      th-cam.com/video/Rml3UX8no0M/w-d-xo.html

  • @suryakanthbhullha7425
    @suryakanthbhullha7425 ปีที่แล้ว

    Thanks, if you added table populated script that will very helpful.

    • @LearnatKnowstar
      @LearnatKnowstar  ปีที่แล้ว

      Thank you. We have started adding table scripts to our latest videos.

  • @nikhilkumarchaudhary9593
    @nikhilkumarchaudhary9593 4 ปีที่แล้ว +3

    kindly share how to print this hierarchy in single column like --> adam->natasha->mark in single column

    • @LearnatKnowstar
      @LearnatKnowstar  4 ปีที่แล้ว +1

      Sure, will cover this in a future video.

    • @manjeetrawat2351
      @manjeetrawat2351 2 ปีที่แล้ว

      Use ..... group_concat
      But I think you have cleared your doubt

    • @chu1452
      @chu1452 ปีที่แล้ว

      ​@@LearnatKnowstar is the video uploaded already mam?

  • @KishoreKumarKokkula
    @KishoreKumarKokkula 2 ปีที่แล้ว

    You did for one level only, you can't get full & complete hierarchy with just one self join, if you can make it plz share

    • @LearnatKnowstar
      @LearnatKnowstar  2 ปีที่แล้ว

      You can find the tutorial for all levels here -
      th-cam.com/video/Rml3UX8no0M/w-d-xo.html

  • @priyankadevarapalli7295
    @priyankadevarapalli7295 4 ปีที่แล้ว +1

    why is it not mentioned as self join in self join and mentioned as inner join?

    • @LearnatKnowstar
      @LearnatKnowstar  4 ปีที่แล้ว

      Self join is a type of inner join

    • @hichamsabah31
      @hichamsabah31 ปีที่แล้ว

      Table a inner join Table a means you are joining a table to itself, hence self-join.

  • @saileelavamsikrishna
    @saileelavamsikrishna 2 ปีที่แล้ว +1

    I was asked to find all direct and indirect subordinates with given manager name🤦🏻‍♂️

    • @LearnatKnowstar
      @LearnatKnowstar  2 ปีที่แล้ว +1

      Thank you. We will be posting a video soon to find the complete employee manager hierarchy.

  • @cleversachin
    @cleversachin 2 ปีที่แล้ว

    This is not hirearchy. hirearchy means a particular employee's entire hirearchy