We Learn SQL #12 | SQL Subqueries in FROM

Поделиться
HTML-код
  • Опубликовано: 16 окт 2024
  • Discover uses of SQL Subqueries in the FROM clause. Write better inquiries and work more efficiently.
    If you want to learn or practice SQL, check out learnsql.com/.
    Hi, I’m Adrian. This is a video in the series about SQL basics. In the previous videos, we learned a few types of SQL subqueries. Today, we’ll talk about another kind: SQL subqueries in the FROM clause.
    Let’s learn SQL together!
    👌 Subscribe to our channel and leave a comment!
    👌 Do you want to learn SQL? Go to LearnSQL.com and choose the course or track that is best for you!
    👌 Join us on Facebook: / welearnsql
    🔊 Music: www.bensound.com/

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

  • @granand
    @granand 2 года назад +6

    Hi Adrian, Thank you a ton for this series. Greatly appreciated but please can you tone down the volume of the music and give us the raw data so we can practice along with you.

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

      It would be amazing to have the raw data

  • @stefanhaagedoorn3690
    @stefanhaagedoorn3690 3 года назад +7

    Great video! Just that the music is a bit too loud compared to your voice.

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

    Thank you for the explanation but please can you reduce the background sound in subsequent videos, it was overshadowing your voice and was quite distracting. Thanks again

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

    Hey Adrian! Thanks for the tutorials. They have been very very helpful. Is there any way you can make these databases available for us to practice along?

  • @gotchihaeyo1825
    @gotchihaeyo1825 2 года назад +2

    Please no music.
    But thanks for the video.

  • @Anass_076
    @Anass_076 5 месяцев назад

    That was quite helpful, thank you so much, but would you mind turn off the background music, it's distracting, I can barely hear your voice.

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

    Thanks. This is a very good example!

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

    Hi, Taking the example table from this video, what would be the most efficient way (in MySQL) to get BOTH, max. national average value AND the countrt name it applies to?
    It can be achieved with WHERE avg_rating = ( SELECT max (... ) but that would require another subquery, nearly the same as the first subquery that gets the AVG.

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

    I tried implementing the following query but it won´t work.
    It says something about missing an alias for subselect in the from clause.
    SELECT MAX (COSTO_UNIT) FROM (
    SELECT AVG (VALOR_UNIT) AS COSTO_UNIT, PAIS_ORIG FROM DETALLEI
    GROUP BY PAIS_ORIG);

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

      Try this:
      SELECT MAX (COSTO_UNIT) FROM (
      SELECT AVG (VALOR_UNIT) AS COSTO_UNIT, PAIS_ORIG FROM DETALLEI
      GROUP BY PAIS_ORIG) as sub;

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

      @@feliksprzybyszewski4033 Hey it worked, thank you. I´m still learning. SQL has become very useful for me in my job.

  • @cv-if6wd
    @cv-if6wd 2 года назад +1

    music is a bit distracting TBH. Thanks for the video.

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

    video number 10 missing or am I missing something

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

      Here it is: ruclips.net/video/um3GXj_TB5U/видео.html