Hierarchical SQL Queries: Databases for Developers #16

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

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

  • @edgards
    @edgards 6 лет назад +15

    Fantastic video!! it's 8pm here at my office and I'm dancing because this function has helped me a lot.

  • @Samalbabu1
    @Samalbabu1 4 года назад +3

    No where on web I found such helpful fundamental description on hierarchy..!! Thank you 😊

  • @phamucmanh1750
    @phamucmanh1750 3 года назад +2

    So amazing ! Keep producing videos, please. Thank you !

  • @cavin3401
    @cavin3401 3 года назад +1

    Snowden is now teaching SQL seems FUN

  • @mohammadalijavaheri771
    @mohammadalijavaheri771 2 года назад

    thank you for this video

  • @CalvinYio
    @CalvinYio 2 года назад +1

    just made reading a while wall of text easier but is there any tutorial or exercise i can practise this with?

    • @TheMagicofSQL
      @TheMagicofSQL  2 года назад +1

      You can find an interactive tutorial at livesql.oracle.com/apex/livesql/file/tutorial_GQMLEEPG5ARVSIFGQRD3SES92.html

  • @jaiwr9460
    @jaiwr9460 4 года назад +2

    i love the effort

  • @shashankjain2270
    @shashankjain2270 3 года назад

    Great Video!, Helped me understand the concept .

    • @TheMagicofSQL
      @TheMagicofSQL  3 года назад

      You're welcome, glad you found this useful

  • @jallunick1032
    @jallunick1032 2 года назад

    Where can I find the sql queries shown in this video?

    • @TheMagicofSQL
      @TheMagicofSQL  2 года назад

      You can join the courses at
      devgym.oracle.com/pls/apex/dg/class/databases-for-developers-foundations.html
      devgym.oracle.com/pls/apex/dg/class/databases-for-developers-next-level.html

  • @bostonmacosx
    @bostonmacosx 4 года назад

    Ok...why in the recursive with do you have a "yf." there is no alias refereing to a yf table...

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад

      You mean here? ruclips.net/video/pB_nOIk3mmY/видео.html
      It's on the join to your_family yf in the second block of the union all

    • @bostonmacosx
      @bostonmacosx 4 года назад

      @@TheMagicofSQL Yeah it was a bit off the screen..but I see it now....
      My only question is can you look up the tree as well as down so if I select a middle of hte road tree item can I still see the whole tree or do I always need to start at the root..

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад +1

      You can go up or down the tree, just flip the tables in the join criteria.
      If you're asking if you can go up AND down in one query... yes it's possible. You need to do both the joins in both directions and have cycle detection. Here's a connect by example:
      with rws as (
      select level x, lag ( level ) over ( order by level ) y
      from dual
      connect by level

  • @DavidLeiser88
    @DavidLeiser88 4 года назад

    What to do if you dont know the root? Can this be done in the same statement or should this be done in a seperate querry?

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад +1

      You can use a subquery to identify the root row(s). This works for connect by (start with col in ( select ... ) ) and the base query in recursive with.

  • @aggreyafray6869
    @aggreyafray6869 6 лет назад +1

    hi just inquiry can i use those functions in mysql and php?

    • @TheMagicofSQL
      @TheMagicofSQL  6 лет назад +1

      MySQL does support recursive with/CTEs. I'm not sure if/how it covers all the features discussed here though.

  • @ashutoshshrivastava9663
    @ashutoshshrivastava9663 4 года назад

    What about Binary.

  • @AndiRadyKurniawan
    @AndiRadyKurniawan 4 года назад

    Is the hierachical query faster than the nested set model?

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад

      I'm not familiar with the nested set model - could you clarify what this is?

    • @AndiRadyKurniawan
      @AndiRadyKurniawan 4 года назад

      @@TheMagicofSQL it's a way to manage hierarchical data where a separate table is used to store the boundaries of the node in the tree. You perform the query on this separate table instead of the actual table. See en.wikipedia.org/wiki/Nested_set_model

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад +1

      Gotcha. It really depends on the query you're running. If you need to traverse the tree, I suspect connect by/recursive with will be faster. It really comes down to the data and your query though

  • @mario17-t34
    @mario17-t34 4 года назад

    Thanks much, So this is for Oracle, I think something similar can be done on MS? (and without music-) Thanks much

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад

      Connect by is specific to Oracle Database; I imagine recursive with works on MS, but I don't know the details
      You have to listen to music whichever database you use ;)

  • @jeandedieuntirampeba8817
    @jeandedieuntirampeba8817 4 года назад

    WHAT CAN I DO WITH MYSQL WHEN I WANT TO RESOLVE THE PROBLEM LIKE THAT?

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад

      I focus on Oracle Database here, so I'm not sure; sorry!

  • @atulgupta9301
    @atulgupta9301 4 года назад

    Not able to understand the syntax.

    • @TheMagicofSQL
      @TheMagicofSQL  4 года назад

      What exactly are you struggling with?

  • @neeleshshah
    @neeleshshah Год назад

    Oh.. to take care of divorces, re marriages, children from multiple marriages.. and… shocker.. marriages of cousins (at a broad 4th/5th level).. i had to patch up the data model.. !!

  • @samt1705
    @samt1705 3 года назад +1

    The background music needs to be changed.

  • @KirillBezzubkine
    @KirillBezzubkine 4 года назад +2

    Video s good but this damn stupid BG music is really distracting

  • @wiktor1983
    @wiktor1983 2 года назад

    "But, of course, in real life everyone has two parents" In 2022 is not so obvious...

  • @dummuvikash4957
    @dummuvikash4957 3 года назад

  • @JustBCWi
    @JustBCWi 4 года назад +1

    Thumbed down, misleading title. This is "Oracle Databases" for developers

  • @enockoloo3814
    @enockoloo3814 3 года назад

    too much illustration is distracting and annoying.

    • @TheMagicofSQL
      @TheMagicofSQL  3 года назад

      What specifically is distracting you?